Add "nosni" option to send empty SNI (#3214)

* Allow not to send SNI

* Allow reality not to send SNI
This commit is contained in:
风扇滑翔翼 2024-04-01 23:02:19 +08:00 committed by yuhan6665
parent ba57ccdd45
commit ec2224974d
2 changed files with 11 additions and 1 deletions

View file

@ -116,6 +116,8 @@ func UClient(c net.Conn, config *Config, ctx context.Context, dest net.Destinati
}
if utlsConfig.ServerName == "" {
utlsConfig.ServerName = dest.Address.String()
} else if strings.ToLower(utlsConfig.ServerName) == "nosni" { // If ServerName is set to "nosni", we set it empty.
utlsConfig.ServerName = ""
}
uConn.ServerName = utlsConfig.ServerName
fingerprint := tls.GetFingerprint(config.Fingerprint)