From 8e90d294ca7cb2460bd31cc544639a6ea7efbe9d Mon Sep 17 00:00:00 2001 From: Riccardo Montagnin Date: Tue, 13 Sep 2022 10:02:19 +0200 Subject: [PATCH] feat: support HTTPS inside websocket (#9416) --- rpc/jsonrpc/client/ws_client.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/rpc/jsonrpc/client/ws_client.go b/rpc/jsonrpc/client/ws_client.go index 09b41888f..5a4839b04 100644 --- a/rpc/jsonrpc/client/ws_client.go +++ b/rpc/jsonrpc/client/ws_client.go @@ -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 }