修正action;将ConnWrapper的GetRawConn改为Upstream

This commit is contained in:
e1732a364fed
2000-01-01 00:00:00 +00:00
parent eaa57b390f
commit 4e19050315
6 changed files with 23 additions and 15 deletions

View File

@@ -88,20 +88,26 @@ jobs:
run: |
echo "ASSET_NAME=vs_gui_${{ matrix.os }}_${{ matrix.goarch }}" | Out-File -FilePath $env:GITHUB_ENV -Append
- if: ${{ matrix.os == 'macos-latest' }}
name: macos gnu-tar extra step
run: |
echo "PATH=\"$(brew --prefix)/opt/gnu-tar/libexec/gnubin:$PATH\"" >> $GITHUB_ENV
- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19
- name: Build
- if: ${{ matrix.os != 'macos-latest' }}
name: Build
run: |
cd cmd/verysimple/ && make -f Makefile_r_gui PACKNAME=${{ env.ASSET_NAME }} BUILD_VERSION=${{ github.event.inputs.tagName }}
- if: ${{ matrix.os == 'macos-latest' }}
name: macos Build
run: |
cd cmd/verysimple
go build -tags "gui" -trimpath -ldflags "-X 'main.Version=${{ github.event.inputs.tagName }}' -s -w -buildid="
gtar -cJf ${{ env.ASSET_NAME }}.tar.xz verysimple* -C ../../ examples/
rm verysimple*
- name: touch xz archive
shell: bash
run: |

View File

@@ -90,7 +90,7 @@ func IsStrUDP_network(s string) bool {
// 返回它所包装前的 那一层 net.Conn, 不一定是 基本连接,
// 所以仍然可以继续 被识别为 ConnWrapper 并继续解包.
type ConnWrapper interface {
GetRawConn() net.Conn
Upstream() net.Conn
}
// part of net.Conn

View File

@@ -19,7 +19,7 @@ type TCPConn struct {
isServerEnd bool
}
func (c *TCPConn) GetRawConn() net.Conn {
func (c *TCPConn) Upstream() net.Conn {
return c.Conn
}

View File

@@ -8,8 +8,8 @@ import (
"github.com/e1732a364fed/v2ray_simple/utils"
)
//trojan比较简洁这个 UserTCPConn 只是用于读取握手读取时读到的剩余的缓存。
//实现 net.Conn, io.ReaderFrom, utils.User, utils.MultiWriter, netLayer.Splicer, netLayer.ConnWrapper
// trojan比较简洁这个 UserTCPConn 只是用于读取握手读取时读到的剩余的缓存。
// 实现 net.Conn, io.ReaderFrom, utils.User, utils.MultiWriter, netLayer.Splicer, netLayer.ConnWrapper
type UserTCPConn struct {
net.Conn
User
@@ -22,7 +22,7 @@ type UserTCPConn struct {
isServerEnd bool
}
func (c *UserTCPConn) GetRawConn() net.Conn {
func (c *UserTCPConn) Upstream() net.Conn {
return c.Conn
}

View File

@@ -36,7 +36,7 @@ func (u *UserTCPConn) GetProtocolVersion() int {
return int(u.version)
}
func (c *UserTCPConn) GetRawConn() net.Conn {
func (c *UserTCPConn) Upstream() net.Conn {
return c.Conn
}

View File

@@ -27,8 +27,8 @@ func init() {
}
//有TLS, network为tcp或者unix, 无AdvLayer.
//grpc 这种多路复用的链接是绝对无法开启 lazy的, ws 理论上也只有服务端发向客户端的链接 内嵌tls时可以lazy但暂不考虑
// 有TLS, network为tcp或者unix, 无AdvLayer.
// grpc 这种多路复用的链接是绝对无法开启 lazy的, ws 理论上也只有服务端发向客户端的链接 内嵌tls时可以lazy但暂不考虑
func CanLazyEncrypt(x proxy.BaseInterface) bool {
return x.IsUseTLS() && CanNetwork_tlsLazy(x.Network()) && x.AdvancedLayer() == ""
@@ -43,7 +43,9 @@ func CanNetwork_tlsLazy(n string) bool {
}
// tryTlsLazyRawRelay 尝试能否直接对拷,对拷 直接使用 原始 TCPConn也就是裸奔转发.
// 如果在linux上则和 xtls的splice 含义相同. 在其他系统时与xtls-direct含义相同。
//
// 如果在linux上则和 xtls的splice 含义相同. 在其他系统时与xtls-direct含义相同。
//
// 我们内部先 使用 SniffConn 进行过滤分析然后再判断进化为splice / 退化为普通拷贝.
//
// useSecureMethod仅用于 tls_lazy_secure
@@ -109,7 +111,7 @@ func tryTlsLazyRawRelay(connid uint32, useSecureMethod bool, proxy_client proxy.
rawWRC = tlsConn.GetRaw(true)
} else {
wrcWrapper := wrc.(netLayer.ConnWrapper)
tlsConn := wrcWrapper.GetRawConn().(*tlsLayer.Conn)
tlsConn := wrcWrapper.Upstream().(*tlsLayer.Conn)
rawWRC = tlsConn.GetRaw(true)
}