Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is https not supported? #794

Open
yuting-fan opened this issue Jun 22, 2022 · 6 comments · May be fixed by #950
Open

Is https not supported? #794

yuting-fan opened this issue Jun 22, 2022 · 6 comments · May be fixed by #950
Labels

Comments

@yuting-fan
Copy link

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 with https?

@ayjayt
Copy link

ayjayt commented Jul 21, 2023

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.

@ayjayt
Copy link

ayjayt commented Jul 21, 2023

Infuriating:

switch u.Scheme {

@ghost
Copy link

ghost commented Jul 21, 2023

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?"

@ghost
Copy link

ghost commented Jun 15, 2024

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?

@adrianosela
Copy link

adrianosela commented Jul 16, 2024

Hey folks, are there no active plans to support websockets over HTTPS proxies?

cc @canelohill , etc

@ghost
Copy link

ghost commented Jul 16, 2024

@adrianosela see #939

@134130 134130 linked a pull request Jul 18, 2024 that will close this issue
12 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
5 participants