Skip to content

Commit 681afbc

Browse files
authored
Merge pull request #12 from getlantern/supported-protos
Supported protos
2 parents 4eb3658 + e245c15 commit 681afbc

File tree

3 files changed

+37
-11
lines changed

3 files changed

+37
-11
lines changed

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ go 1.23.6
44

55
toolchain go1.24.1
66

7-
replace github.com/sagernet/sing-box => github.com/getlantern/sing-box-minimal v1.11.6-0.20250411182257-639652d5e1c6
7+
replace github.com/sagernet/sing-box => github.com/getlantern/sing-box-minimal v1.11.6-0.20250423191758-9d71c5b570dc
88

99
replace github.com/tetratelabs/wazero => github.com/refraction-networking/wazero v1.7.1-w
1010

@@ -18,7 +18,7 @@ require (
1818
github.com/getlantern/lantern-water v0.0.0-20250331153903-07abebe611e8
1919
github.com/gobwas/ws v1.4.0
2020
github.com/refraction-networking/water v0.7.0-alpha
21-
github.com/sagernet/sing v0.6.6-0.20250406121928-926a5a1e8bb7
21+
github.com/sagernet/sing v0.6.6
2222
github.com/sagernet/sing-box v1.11.5
2323
github.com/sagernet/sing-dns v0.4.1
2424
github.com/sagernet/wireguard-go v0.0.1-beta.5
@@ -140,7 +140,7 @@ require (
140140
github.com/sagernet/sing-shadowsocks v0.2.7 // indirect
141141
github.com/sagernet/sing-shadowsocks2 v0.2.0 // indirect
142142
github.com/sagernet/sing-shadowtls v0.2.0 // indirect
143-
github.com/sagernet/sing-tun v0.6.1 // indirect
143+
github.com/sagernet/sing-tun v0.6.4 // indirect
144144
github.com/sagernet/sing-vmess v0.2.0 // indirect
145145
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 // indirect
146146
github.com/sagernet/utls v1.6.7 // indirect

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,8 @@ github.com/getlantern/lantern-water v0.0.0-20250331153903-07abebe611e8/go.mod h1
159159
github.com/getlantern/ops v0.0.0-20220713155959-1315d978fff7/go.mod h1:D5ao98qkA6pxftxoqzibIBBrLSUli+kYnJqrgBf9cIA=
160160
github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534 h1:3BwvWj0JZzFEvNNiMhCu4bf60nqcIuQpTYb00Ezm1ag=
161161
github.com/getlantern/ops v0.0.0-20231025133620-f368ab734534/go.mod h1:ZsLfOY6gKQOTyEcPYNA9ws5/XHZQFroxqCOhHjGcs9Y=
162-
github.com/getlantern/sing-box-minimal v1.11.6-0.20250411182257-639652d5e1c6 h1:beonyvZrFWqSHCXqA9J6aghD5yzRzJFGrAR9bDqfKEM=
163-
github.com/getlantern/sing-box-minimal v1.11.6-0.20250411182257-639652d5e1c6/go.mod h1:iPA+z1tIMGSsiw5GGN+6Oeroc/pMcSCQm6pASDJltcM=
162+
github.com/getlantern/sing-box-minimal v1.11.6-0.20250423191758-9d71c5b570dc h1:wJAJICXokNF1ejKVXmXqt8WtYkWZ9VLV0jvhKiBwXTE=
163+
github.com/getlantern/sing-box-minimal v1.11.6-0.20250423191758-9d71c5b570dc/go.mod h1:zyJWioN4bQlYgjBGxAY5LSzgMT2y8aEvJ34ga5ignDA=
164164
github.com/glycerine/go-unsnap-stream v0.0.0-20180323001048-9f0cb55181dd/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
165165
github.com/glycerine/go-unsnap-stream v0.0.0-20181221182339-f9677308dec2/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
166166
github.com/glycerine/go-unsnap-stream v0.0.0-20190901134440-81cf024a9e0a/go.mod h1:/20jfyN9Y5QPEAprSgKAUr+glWDY39ZiUEAYOEv5dsE=
@@ -446,8 +446,8 @@ github.com/sagernet/quic-go v0.49.0-beta.1/go.mod h1:uesWD1Ihrldq1M3XtjuEvIUqi8W
446446
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc=
447447
github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU=
448448
github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo=
449-
github.com/sagernet/sing v0.6.6-0.20250406121928-926a5a1e8bb7 h1:ZJauxLmH12Gzv3nucfjsSBQw9UA8t7Sxu8pYHBSP2TU=
450-
github.com/sagernet/sing v0.6.6-0.20250406121928-926a5a1e8bb7/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
449+
github.com/sagernet/sing v0.6.6 h1:3JkvJ0vqDj/jJcx0a+ve/6lMOrSzZm30I3wrIuZtmRE=
450+
github.com/sagernet/sing v0.6.6/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak=
451451
github.com/sagernet/sing-dns v0.4.1 h1:nozS7iqpxZ7aV73oHbkD/8haOvf3XXDCgT//8NdYirk=
452452
github.com/sagernet/sing-dns v0.4.1/go.mod h1:dweQs54ng2YGzoJfz+F9dGuDNdP5pJ3PLeggnK5VWc8=
453453
github.com/sagernet/sing-mux v0.3.1 h1:kvCc8HyGAskDHDQ0yQvoTi/7J4cZPB/VJMsAM3MmdQI=
@@ -460,8 +460,8 @@ github.com/sagernet/sing-shadowsocks2 v0.2.0 h1:wpZNs6wKnR7mh1wV9OHwOyUr21VkS3wK
460460
github.com/sagernet/sing-shadowsocks2 v0.2.0/go.mod h1:RnXS0lExcDAovvDeniJ4IKa2IuChrdipolPYWBv9hWQ=
461461
github.com/sagernet/sing-shadowtls v0.2.0 h1:cLKe4OAOFwuhmAIuPLj//CIL7Q9js+pIDardhJ+/osk=
462462
github.com/sagernet/sing-shadowtls v0.2.0/go.mod h1:agU+Fw5X+xnWVyRHyFthoZCX3MfWKCFPm4JUf+1oaxo=
463-
github.com/sagernet/sing-tun v0.6.1 h1:4l0+gnEKcGjlWfUVTD+W0BRApqIny/lU2ZliurE+VMo=
464-
github.com/sagernet/sing-tun v0.6.1/go.mod h1:fisFCbC4Vfb6HqQNcwPJi2CDK2bf0Xapyz3j3t4cnHE=
463+
github.com/sagernet/sing-tun v0.6.4 h1:3Iew6UtAf1+mucVeHKNhAEQI5xmq3CUCbGptUbjebts=
464+
github.com/sagernet/sing-tun v0.6.4/go.mod h1:fisFCbC4Vfb6HqQNcwPJi2CDK2bf0Xapyz3j3t4cnHE=
465465
github.com/sagernet/sing-vmess v0.2.0 h1:pCMGUXN2k7RpikQV65/rtXtDHzb190foTfF9IGTMZrI=
466466
github.com/sagernet/sing-vmess v0.2.0/go.mod h1:jDAZ0A0St1zVRkyvhAPRySOFfhC+4SQtO5VYyeFotgA=
467467
github.com/sagernet/smux v0.0.0-20231208180855-7041f6ea79e7 h1:DImB4lELfQhplLTxeq2z31Fpv8CQqqrUwTbrIRumZqQ=

protocol/register.go

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,39 @@
11
package protocol
22

33
import (
4-
"github.com/getlantern/sing-box-extensions/protocol/amnezia"
54
"github.com/sagernet/sing-box/adapter/endpoint"
65
"github.com/sagernet/sing-box/adapter/inbound"
76
"github.com/sagernet/sing-box/adapter/outbound"
87
"github.com/sagernet/sing-box/include"
98

9+
"github.com/getlantern/sing-box-extensions/protocol/amnezia"
10+
1011
"github.com/getlantern/sing-box-extensions/protocol/algeneva"
1112
"github.com/getlantern/sing-box-extensions/protocol/outline"
1213
)
1314

15+
var supportedProtocols = []string{
16+
// custom protocols
17+
"algeneva",
18+
"amnezia",
19+
"outline",
20+
21+
// sing-box built-in protocols
22+
"http",
23+
"hysteria",
24+
"hysteria2",
25+
"shadowsocks",
26+
"shadowtls",
27+
"socks",
28+
"ssh",
29+
"tor",
30+
"trojan",
31+
"tuic",
32+
"vless",
33+
"vmess",
34+
"wireguard",
35+
}
36+
1437
func GetRegistries() (*inbound.Registry, *outbound.Registry, *endpoint.Registry) {
1538
outboundRegistry := include.OutboundRegistry()
1639
inboundRegistry := include.InboundRegistry()
@@ -27,7 +50,6 @@ func GetRegistries() (*inbound.Registry, *outbound.Registry, *endpoint.Registry)
2750

2851
func registerInbounds(registry *inbound.Registry) {
2952
algeneva.RegisterInbound(registry)
30-
3153
}
3254

3355
func registerOutbounds(registry *outbound.Registry) {
@@ -39,3 +61,7 @@ func registerOutbounds(registry *outbound.Registry) {
3961
func registerEndpoints(registry *endpoint.Registry) {
4062
amnezia.RegisterEndpoint(registry)
4163
}
64+
65+
func SupportedProtocols() []string {
66+
return supportedProtocols
67+
}

0 commit comments

Comments
 (0)