Open yuting-fan opened 2 years ago
Websockets does support https. The client dialers expect you to pass scheme wss://
, not https://
.
That being said, the behavior your mentioning IMO is an issue (so picky about scheme), but bottom line is that gorilla websocket does support TLS and will connect to an https server.
The issue is asking about support for HTTPS proxy servers, not whether the package supports WSS or not.
To reduce confusion, the issue title should be changed to "Are HTTPS proxy servers supported?"
There are two URLs in play in the dial code:
The first is the URL used for the upgrade request. The dialer uses the HTTPS protocol for the upgrade request when the application dials a WSS URL.
The second is the URL for the proxy (if any). The proxy URL is returned from Dialer.Proxy.
It looks like gorilla websocket intends to support https, e.g logic here.
This is the protocol used for the upgrade request. The WSS protocol uses HTTPS for the upgrade request.
However, https is not registered during init here.
The registration is for proxy URLs, not for the upgrade request URL.
This caused https to be considered as an unknown proxy when we use https proxy, error thrown from here.
HTTPS proxies are not supported, but that does not imply that WSS (and the HTTPS upgrade request) are not supported through a proxy.
@yuting-fan If the code failed here in your application, then your application's Dialer.Proxy function returned an HTTPS URL. Did you intend to use an HTTPS proxy?
Edit: @yuting-fan Did you encounter a problem in your application, or are you speculating that there's a bug?
Hey folks, are there no active plans to support websockets over HTTPS proxies?
cc @canelohill , etc
@adrianosela see #939
It looks like gorilla websocket intends to support https, e.g logic here.
However, https is not registered during init here.
This caused https to be considered as an unknown proxy when we use https proxy, error thrown from here.
Is this a bug? Shouldn't the
proxy_RegisterDialerType
be initialized withhttps
?