feat: support HTTPS inside websocket (#9416) (#9422)

This commit is contained in:
mergify[bot]
2022-09-13 11:12:38 +02:00
committed by GitHub
parent 48ebd22dfc
commit c6343aabe3

View File

@@ -89,8 +89,10 @@ func NewWS(remoteAddr, endpoint string, options ...func(*WSClient)) (*WSClient,
if err != nil {
return nil, err
}
// default to ws protocol, unless wss is explicitly specified
if parsedURL.Scheme != protoWSS {
// default to ws protocol, unless wss or https is specified
if parsedURL.Scheme == protoHTTPS {
parsedURL.Scheme = protoWSS
} else if parsedURL.Scheme != protoWSS {
parsedURL.Scheme = protoWS
}