mirror of
https://github.com/MetaCubeX/Clash.Meta.git
synced 2025-04-11 04:50:56 +00:00
Revert "feat: support xtaci/smux for ss v2ray-plugin"
This reverts commit f2c4ff8f6e
.
This commit is contained in:
parent
5b4c2c0ce2
commit
8be0ad90cc
4 changed files with 5 additions and 26 deletions
|
@ -67,7 +67,6 @@ type v2rayObfsOption struct {
|
|||
Headers map[string]string `obfs:"headers,omitempty"`
|
||||
SkipCertVerify bool `obfs:"skip-cert-verify,omitempty"`
|
||||
Mux bool `obfs:"mux,omitempty"`
|
||||
MuxProtocol string `obfs:"mux-protocol,omitempty"`
|
||||
V2rayHttpUpgrade bool `obfs:"v2ray-http-upgrade,omitempty"`
|
||||
V2rayHttpUpgradeFastOpen bool `obfs:"v2ray-http-upgrade-fast-open,omitempty"`
|
||||
}
|
||||
|
@ -273,7 +272,6 @@ func NewShadowSocks(option ShadowSocksOption) (*ShadowSocks, error) {
|
|||
Path: opts.Path,
|
||||
Headers: opts.Headers,
|
||||
Mux: opts.Mux,
|
||||
MuxProtocol: opts.MuxProtocol,
|
||||
V2rayHttpUpgrade: opts.V2rayHttpUpgrade,
|
||||
V2rayHttpUpgradeFastOpen: opts.V2rayHttpUpgradeFastOpen,
|
||||
}
|
||||
|
|
1
go.mod
1
go.mod
|
@ -51,7 +51,6 @@ require (
|
|||
github.com/stretchr/testify v1.10.0
|
||||
github.com/vmihailenco/msgpack/v5 v5.4.1
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8
|
||||
github.com/xtaci/smux v1.5.34
|
||||
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7
|
||||
go.uber.org/automaxprocs v1.6.0
|
||||
go4.org/netipx v0.0.0-20231129151722-fdeea329fbba
|
||||
|
|
2
go.sum
2
go.sum
|
@ -218,8 +218,6 @@ github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAh
|
|||
github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8 h1:5h/BUHu93oj4gIdvHHHGsScSTMijfx5PeYkE/fJgbpc=
|
||||
github.com/wk8/go-ordered-map/v2 v2.1.8/go.mod h1:5nJHM5DyteebpVlHnWMV0rPz6Zp7+xBAnxjb1X5vnTw=
|
||||
github.com/xtaci/smux v1.5.34 h1:OUA9JaDFHJDT8ZT3ebwLWPAgEfE6sWo2LaTy3anXqwg=
|
||||
github.com/xtaci/smux v1.5.34/go.mod h1:OMlQbT5vcgl2gb49mFkYo6SMf+zP3rcjcwQz7ZU7IGY=
|
||||
github.com/yusufpapurcu/wmi v1.2.4 h1:zFUKzehAFReQwLys1b/iSMl+JQGSCSjtVqQn9bBrPo0=
|
||||
github.com/yusufpapurcu/wmi v1.2.4/go.mod h1:SBZ9tNy3G9/m5Oi98Zks0QjeHVDvuK0qfxQmPyzfmi0=
|
||||
gitlab.com/go-extension/aes-ccm v0.0.0-20230221065045-e58665ef23c7 h1:UNrDfkQqiEYzdMlNsVvBYOAJWZjdktqFE9tQh5BT2+4=
|
||||
|
|
|
@ -8,7 +8,6 @@ import (
|
|||
|
||||
"github.com/metacubex/mihomo/component/ca"
|
||||
"github.com/metacubex/mihomo/transport/vmess"
|
||||
smux "github.com/xtaci/smux"
|
||||
)
|
||||
|
||||
// Option is options of websocket obfs
|
||||
|
@ -21,7 +20,6 @@ type Option struct {
|
|||
SkipCertVerify bool
|
||||
Fingerprint string
|
||||
Mux bool
|
||||
MuxProtocol string
|
||||
V2rayHttpUpgrade bool
|
||||
V2rayHttpUpgradeFastOpen bool
|
||||
}
|
||||
|
@ -67,25 +65,11 @@ func NewV2rayObfs(ctx context.Context, conn net.Conn, option *Option) (net.Conn,
|
|||
}
|
||||
|
||||
if option.Mux {
|
||||
if option.MuxProtocol == "smux" {
|
||||
session, err := smux.Client(conn, nil)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
session.Open()
|
||||
stream, err := session.OpenStream()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
conn = stream
|
||||
} else {
|
||||
conn = NewMux(conn, MuxOption{
|
||||
ID: [2]byte{0, 0},
|
||||
Host: "127.0.0.1",
|
||||
Port: 0,
|
||||
})
|
||||
}
|
||||
conn = NewMux(conn, MuxOption{
|
||||
ID: [2]byte{0, 0},
|
||||
Host: "127.0.0.1",
|
||||
Port: 0,
|
||||
})
|
||||
}
|
||||
return conn, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue