add host for mws and ws

This commit is contained in:
wenyifan
2026-06-29 16:13:52 +08:00
parent a24d79fd45
commit c2cb8f93d2
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -114,6 +114,7 @@ func (d *wsDialer) Handshake(ctx context.Context, conn net.Conn, options ...dial
urlObj := url.URL{Scheme: "ws", Host: host, Path: d.md.path}
if d.tlsEnabled {
urlObj.Scheme = "wss"
d.options.TLSConfig.ServerName = host
dialer.TLSClientConfig = d.options.TLSConfig
dialer.NetDialTLSContext = func(ctx context.Context, network, addr string) (net.Conn, error) {
client, err := util.NewUTLSWebSocketClient(conn, d.options.TLSConfig, d.md.useH2)