Add hysteria2 realm service and support

This commit is contained in:
世界
2026-05-10 13:31:53 +08:00
parent 89d83aa6d2
commit 094808a4fa
20 changed files with 1167 additions and 33 deletions
+5
View File
@@ -5,6 +5,7 @@ package include
import (
"github.com/sagernet/sing-box/adapter/inbound"
"github.com/sagernet/sing-box/adapter/outbound"
"github.com/sagernet/sing-box/adapter/service"
"github.com/sagernet/sing-box/dns"
"github.com/sagernet/sing-box/dns/transport/quic"
"github.com/sagernet/sing-box/protocol/hysteria"
@@ -30,3 +31,7 @@ func registerQUICTransports(registry *dns.TransportRegistry) {
quic.RegisterTransport(registry)
quic.RegisterHTTP3Transport(registry)
}
func registerQUICServices(registry *service.Registry) {
hysteria2.RegisterRealmService(registry)
}
+7
View File
@@ -10,6 +10,7 @@ import (
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/adapter/inbound"
"github.com/sagernet/sing-box/adapter/outbound"
"github.com/sagernet/sing-box/adapter/service"
"github.com/sagernet/sing-box/common/listener"
"github.com/sagernet/sing-box/common/tls"
C "github.com/sagernet/sing-box/constant"
@@ -69,3 +70,9 @@ func registerQUICTransports(registry *dns.TransportRegistry) {
return nil, C.ErrQUICNotIncluded
})
}
func registerQUICServices(registry *service.Registry) {
service.Register[option.HysteriaRealmServiceOptions](registry, C.TypeHysteriaRealm, func(ctx context.Context, logger log.ContextLogger, tag string, options option.HysteriaRealmServiceOptions) (adapter.Service, error) {
return nil, C.ErrQUICNotIncluded
})
}
+1
View File
@@ -136,6 +136,7 @@ func ServiceRegistry() *service.Registry {
resolved.RegisterService(registry)
ssmapi.RegisterService(registry)
registerQUICServices(registry)
registerDERPService(registry)
registerCCMService(registry)
registerOCMService(registry)