vulcand / oxy

Go middlewares for HTTP servers & proxies
Apache License 2.0
2.02k stars 324 forks source link

httpForwarder.serveWebSocket Uses global dialer #199

Closed ckaznocha closed 2 years ago

ckaznocha commented 4 years ago

serveWebSocket uses the global websocket.DefaultDialer to dial WebSocket connections. This would not be an issue except each call to serveWebSocket may modify websocket.DefaultDialer.TLSClientConfig. This means there may be unpredictable behavior if an application has more than one forwarder serving WebSockets. This could potentially be the cause of #125

I would also like to add an optSetter to modify the WebSocket Dialer the use of a global dialer is blocking that feature.

Happy to send a PR!

ldez commented 2 years ago

Considering refactoring #229, the specific code for WebSocket has been removed.