-
Notifications
You must be signed in to change notification settings - Fork 20.1k
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
rpc: websocket should respect the "HTTP_PROXY" by default #27264
rpc: websocket should respect the "HTTP_PROXY" by default #27264
Conversation
…nment variables like "HTTP_PROXY"
How about the other schemes then? Do they already respect the env proxy settings? |
Yes, they already respect the env proxy settings. The Lines 197 to 212 in 9ca84e6
In I found this inconsistence behavior between http(s) and ws(s) because I tried to reach a rpc endpoint behind a proxy, the websocket connection can not be established while the http(s) requests works without problem. |
Workaround before the releasing of 1.11.7 replacing rpc.DialOptions(
context.Background(),
"wss://***",
rpc.WithWebsocketDialer(
websocket.Dialer{
Proxy: http.ProxyFromEnvironment,
})) |
…7264) rpc: the default dialer for websocket should respect the proxy environment variables like "HTTP_PROXY"
…hereum#27264)" This reverts commit aff04e0.
…hereum#27264)" This reverts commit aff04e0.
rpc: the default dialer for websocket should respect the proxy environment variables like "HTTP_PROXY"
By default
gorilla/websocket
did respect thehttp_proxy
setting, but thenewClientTransportWS
function explicitly provide awebsocket.Dialer
without a Proxy which overwrites the default one.Related code:
go-ethereum/rpc/websocket.go
Lines 221 to 228 in 9ca84e6