vapor / websocket-kit

WebSocket client library built on SwiftNIO
https://docs.vapor.codes/4.0/advanced/websockets/
MIT License
281 stars 80 forks source link

WSS Proxy Setup Broken #147

Open GEverding opened 10 months ago

GEverding commented 10 months ago

Describe the bug

uri = "\(scheme)://\(host)\(relativePath)\(port)"

This will generate a url like wss://apple.com/asdf:55433 which is not valid for a normal target. For most wss connections the uri should be wss://app.com:443/relativepath assuming the proxy config looks like localhost:55433

Fix: uri = "\(scheme)://\(host):\(port)\(relativePath)"

To Reproduce

Theres a test case that simulates the incorrect result.

Expected behavior

Environment

Additional context

Add any other context about the problem here.

0xTim commented 9 months ago

Yeah that does look like a bug! Would you like to submit a PR?

CWftw commented 9 months ago

@0xTim Created a PR for this and another bug we found when using a proxy #149