chore: relax version restrictions for the snell listener

This commit is contained in:
wwqgtxx committed 2026-07-05 22:29:18 +08:00
1 parent a1c09adb91
commit 02dd143fbb
4 files changed
+8 -3

No files matched your search

+1 -1
View File
@@ -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
+1 -1
View File
@@ -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)
}
+3
View File
@@ -60,6 +60,9 @@ func TestInboundSnell(t *testing.T) {
name string
version int
}{
{"v1", 1},
//{"v2", 2},
{"v3", 3},
{"v4", 4},
{"v5", 5},
}
+3 -1
View File
@@ -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 == "" {