websocket
websocket copied to clipboard
[feature] Support for proxying websocket through https proxy
Is your feature request related to a problem? Please describe.
I need to use a proxy server that itself requires TLS (proxy URL has https scheme).
Describe the solution you'd like
I should be able to use a proxy server (eg, via ProxyFromEnvironment) that has an https scheme and uses TLS. Currently, proxy_RegisterDialerType
only registers the 'http' scheme.
This should also be able to use my client TLSClientConfig
which could be necessary to communicate with my proxy.
Describe alternatives you've considered
I do not see any other alternatives. The workaround suggested in comments below on 12/3/21 is impractical, especially when using ProxyFromEnvironment
and applying this to other libraries. I should not have to mangle my proxy scheme to get this to work.
Possible workaround:
- Hook proxy function to change https to http
- Set Dialer.NetDialContext to tls Dialer.DialContext.