mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-12-02 13:06:47 +00:00
chore: relax version restrictions for the snell listener
This commit is contained in:
1 parent
a1c09adb91
commit
02dd143fbb
4 files changed
+8
-3
No files matched your search
+1
-1
@@ -1805,7 +1805,7 @@ listeners:
|
||||
listen: 0.0.0.0
|
||||
# routing-mark: 0 # 为监听socket设置routing-mark(仅支持linux)
|
||||
psk: your-password
|
||||
version: 4 # 仅支持 4/5
|
||||
version: 4 # 支持 1/2/3/4/5
|
||||
udp: true # UDP over TCP tunnel,默认 true
|
||||
# obfs-opts:
|
||||
# mode: http # 可选:http / tls
|
||||
|
||||
@@ -43,7 +43,7 @@ func NewSnell(options *SnellOption) (*Snell, error) {
|
||||
if options.Version == 0 {
|
||||
options.Version = 4
|
||||
}
|
||||
if options.Version != 4 && options.Version != 5 {
|
||||
if options.Version < 1 || options.Version > 5 {
|
||||
return nil, fmt.Errorf("snell inbound version %d is not supported", options.Version)
|
||||
}
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ func TestInboundSnell(t *testing.T) {
|
||||
name string
|
||||
version int
|
||||
}{
|
||||
{"v1", 1},
|
||||
//{"v2", 2},
|
||||
{"v3", 3},
|
||||
{"v4", 4},
|
||||
{"v5", 5},
|
||||
}
|
||||
|
||||
@@ -41,7 +41,9 @@ func New(config LC.SnellServer, lc C.InboundListenConfig, tunnel C.Tunnel, addit
|
||||
if config.Version == 0 {
|
||||
config.Version = snell.Version4
|
||||
}
|
||||
if config.Version != snell.Version4 && config.Version != snell.Version5 {
|
||||
switch config.Version {
|
||||
case snell.Version1, snell.Version2, snell.Version3, snell.Version4, snell.Version5:
|
||||
default:
|
||||
return nil, fmt.Errorf("snell inbound version %d is not supported", config.Version)
|
||||
}
|
||||
if config.Psk == "" {
|
||||
|
||||
Reference in new issue
Block a user