mirror of
https://github.com/e1732a364fed/v2ray_simple.git
synced 2025-12-24 13:27:56 +08:00
修正action;将ConnWrapper的GetRawConn改为Upstream
This commit is contained in:
16
.github/workflows/build_release_extra.yml
vendored
16
.github/workflows/build_release_extra.yml
vendored
@@ -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: |
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -19,7 +19,7 @@ type TCPConn struct {
|
||||
isServerEnd bool
|
||||
}
|
||||
|
||||
func (c *TCPConn) GetRawConn() net.Conn {
|
||||
func (c *TCPConn) Upstream() net.Conn {
|
||||
return c.Conn
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
|
||||
10
tls_lazy.go
10
tls_lazy.go
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user