fix: set sni to servername if not specified for trojan outbound (#1991)

This commit is contained in:
WeidiDeng
2025-04-24 19:50:16 +08:00
committed by GitHub
parent 5dce957755
commit 468cfc3cc4

View File

@@ -295,6 +295,10 @@ func (t *Trojan) Close() error {
func NewTrojan(option TrojanOption) (*Trojan, error) {
addr := net.JoinHostPort(option.Server, strconv.Itoa(option.Port))
if option.SNI == "" {
option.SNI = option.Server
}
t := &Trojan{
Base: &Base{
name: option.Name,