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

curl doesn't use "https_proxy" for websockets "wss" requests #12031

Closed
candrews opened this issue Oct 4, 2023 · 8 comments
Closed

curl doesn't use "https_proxy" for websockets "wss" requests #12031

candrews opened this issue Oct 4, 2023 · 8 comments

Comments

@candrews
Copy link

candrews commented Oct 4, 2023

I did this

$ https_proxy='http://notvalid' curl 'wss://google.com.com/service'
curl: (22) Refused WebSockets upgrade: 302
[22]

I expected the following

curl: (5) Could not resolve proxy: notvalid
[5]

curl/libcurl version

curl 8.3.0 (x86_64-pc-linux-musl) libcurl/8.3.0 OpenSSL/3.1.3 zlib/1.2.13 libssh2/1.10.0 nghttp2/1.55.1
Release-Date: 2023-09-13
Protocols: dict file ftp ftps gopher gophers http https imap imaps mqtt pop3 pop3s rtsp scp sftp smb smbs smtp smtps telnet tftp ws wss
Features: alt-svc AsynchDNS HSTS HTTP2 HTTPS-proxy IPv6 Largefile libz NTLM NTLM_WB SSL threadsafe TLS-SRP UnixSockets

operating system

Fedora Linux 39

@dfandrich
Copy link
Contributor

dfandrich commented Oct 4, 2023 via email

@dfandrich
Copy link
Contributor

dfandrich commented Oct 4, 2023 via email

@candrews
Copy link
Author

candrews commented Oct 4, 2023

The --proxy option does work as expected with Websockets.

Since Websockets use HTTP/HTTPS, I think the HTTP/HTTPS proxy configuration should apply to Websockets connections.

@dfandrich
Copy link
Contributor

dfandrich commented Oct 4, 2023 via email

@candrews
Copy link
Author

candrews commented Oct 4, 2023

Firefox uses the http proxy environment variables for websockets connections. Their UI also has settings http/https/socks only, notably it does not have a separate option to configure websockets requests.

It's well known that Websockets is an HTTP based protocol, so I expected it to use HTTP configuration.

@dfandrich
Copy link
Contributor

dfandrich commented Oct 4, 2023 via email

@bagder
Copy link
Member

bagder commented Oct 5, 2023

If multiple other programs do it, then it's an easier sell.

Agreed. It makes sense to follow established behaviors.

I find it a little strange to support http_proxy and https_proxy for ws and wss simply because it breaks the previously established pattern. It has always been [url scheme]_proxy to check for the proxy, but this asks for something else.

@bagder
Copy link
Member

bagder commented Oct 5, 2023

We might want to check wss_proxy first, and if that is not set, fall back to checking https_proxy...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

3 participants