This commit is contained in:
wenyifan
2023-11-15 17:49:38 +08:00
parent 3038eb66d8
commit 34b9e3b16e
4 changed files with 22 additions and 4 deletions

View File

@ -111,8 +111,13 @@ func (d *wsDialer) Handshake(ctx context.Context, conn net.Conn, options ...dial
})
}
}
client := tls.UClient(conn, utlsConf, tls.HelloCustom)
client.ApplyPreset(util.NewWsSpec())
var client *tls.UConn
if d.md.useH2 {
client = tls.UClient(conn, utlsConf, tls.HelloChrome_Auto)
} else {
client = tls.UClient(conn, utlsConf, tls.HelloCustom)
client.ApplyPreset(util.NewWsSpec())
}
err := client.Handshake()
if err != nil {
return nil, err