denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
93.42k stars 5.18k forks source link

Proxy configuration not used for websocket connections #10743

Open dguggemos opened 3 years ago

dguggemos commented 3 years ago

Proxy configuration provided via environment variables seems not be used for websocket connections. This would however be very useful, especially in corporate environments where a proxy is in place.

lucacasonato commented 3 years ago

Do you mean the WebSocket global?

dguggemos commented 3 years ago

I have configured the environment variables as described here: https://deno.land/manual/linking_to_external_code/proxies#proxies

Then I try to create a WebSocket connection (to an endpoint only accessible via proxy):

var ws = new WebSocket("ws://echo.websocket.org");
geglock commented 3 years ago

I noticed this missing proxy support also recently with the (Web Standard) WebSocket client of deno: https://doc.deno.land/builtin/stable#WebSocket

So probably this issue is not (yet) about the WebSocket server in "deno_std/ws".

geglock commented 3 years ago

@kitsonk should this issue be moved again to denoland/deno?

Officialstrike commented 2 years ago

Currently the websocket library tungstenite doesn't support proxies, would have to wait for issue snapview/tungstenite-rs#177 to be resolved.

technically they use tokio_tungstenite however that's just a wrapper around tungstenite to make it async.