mirror of
https://github.com/SagerNet/sing-box.git
synced 2025-04-05 04:47:37 +03:00
Add wildcard-sni support for shadow-tls inbound
This commit is contained in:
parent
d07adfc833
commit
f2ca81a63c
9 changed files with 308 additions and 79 deletions
|
@ -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,
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue