websocket-kit icon indicating copy to clipboard operation
websocket-kit copied to clipboard

WSS Proxy Setup Broken

Open GEverding opened this issue 1 year ago • 2 comments

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

  • Vapor Framework version:
  • Vapor Toolbox version:
  • OS version:

Additional context

Add any other context about the problem here.

GEverding avatar Jan 27 '24 00:01 GEverding

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

0xTim avatar Feb 13 '24 15:02 0xTim

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

CWftw avatar Feb 21 '24 21:02 CWftw