Add wildcard-sni support for shadow-tls inbound

This commit is contained in:
世界 2025-03-16 23:50:23 +08:00
parent d07adfc833
commit f2ca81a63c
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
9 changed files with 308 additions and 79 deletions

View file

@ -57,7 +57,11 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
}
}
}
handshakeDialer, err := dialer.New(ctx, options.Handshake.DialerOptions, options.Handshake.ServerIsDomain())
serverIsDomain := options.Handshake.ServerIsDomain()
if options.WildcardSNI != option.ShadowTLSWildcardSNIOff {
serverIsDomain = true
}
handshakeDialer, err := dialer.New(ctx, options.Handshake.DialerOptions, serverIsDomain)
if err != nil {
return nil, err
}
@ -73,6 +77,7 @@ func NewInbound(ctx context.Context, router adapter.Router, logger log.ContextLo
},
HandshakeForServerName: handshakeForServerName,
StrictMode: options.StrictMode,
WildcardSNI: shadowtls.WildcardSNI(options.WildcardSNI),
Handler: (*inboundHandler)(inbound),
Logger: logger,
})