Feature: support vmess tls custom servername

This commit is contained in:
Dreamacro
2020-06-01 00:27:04 +08:00
parent 008731c249
commit 71d30e6654
3 changed files with 12 additions and 1 deletions

View File

@ -31,6 +31,7 @@ type WebsocketConfig struct {
Headers http.Header
TLS bool
SkipCertVerify bool
ServerName string
SessionCache tls.ClientSessionCache
}
@ -132,7 +133,9 @@ func StreamWebsocketConn(conn net.Conn, c *WebsocketConfig) (net.Conn, error) {
ClientSessionCache: c.SessionCache,
}
if host := c.Headers.Get("Host"); host != "" {
if c.ServerName != "" {
dialer.TLSClientConfig.ServerName = c.ServerName
} else if host := c.Headers.Get("Host"); host != "" {
dialer.TLSClientConfig.ServerName = host
}
}