修复在HTTPS下无法连接Websocket的问题

This commit is contained in:
刘祥超
2023-01-10 21:20:27 +08:00
parent 230c5c3766
commit d82c03db23

View File

@@ -55,3 +55,16 @@ func (this *ClientTLSConn) SetReadDeadline(t time.Time) error {
func (this *ClientTLSConn) SetWriteDeadline(t time.Time) error { func (this *ClientTLSConn) SetWriteDeadline(t time.Time) error {
return this.rawConn.SetWriteDeadline(t) return this.rawConn.SetWriteDeadline(t)
} }
func (this *ClientTLSConn) SetIsWebsocket(isWebsocket bool) {
tlsConn, ok := this.rawConn.(*tls.Conn)
if ok {
var rawConn = tlsConn.NetConn()
if rawConn != nil {
clientConn, ok := rawConn.(*ClientConn)
if ok {
clientConn.SetIsWebsocket(isWebsocket)
}
}
}
}