Improve OpenVPN & OpenConnect interoperability

This commit is contained in:
世界
2026-07-21 09:38:21 +08:00
parent 5cad5ad42d
commit 2ff294c4f4
47 changed files with 3915 additions and 440 deletions
+7
View File
@@ -8,6 +8,7 @@ import (
"github.com/sagernet/sing-box/adapter"
"github.com/sagernet/sing-box/adapter/endpoint"
C "github.com/sagernet/sing-box/constant"
"github.com/sagernet/sing-box/dns"
"github.com/sagernet/sing-box/log"
"github.com/sagernet/sing-box/option"
E "github.com/sagernet/sing/common/exceptions"
@@ -27,3 +28,9 @@ func registerOpenVPNEndpoints(registry *endpoint.Registry) {
return nil, E.New(`OpenVPN is not included in this build, rebuild with -tags with_openvpn`)
})
}
func registerOpenVPNDNSTransport(registry *dns.TransportRegistry) {
dns.RegisterTransport[option.OpenVPNDNSServerOptions](registry, C.DNSTypeOpenVPN, func(ctx context.Context, logger log.ContextLogger, tag string, options option.OpenVPNDNSServerOptions) (adapter.DNSTransport, error) {
return nil, E.New(`OpenVPN is not included in this build, rebuild with -tags with_openvpn`)
})
}