Conversation
Connection URLs always carried the port, e.g. wss://ws-mt1.pusher.com:443. Some WebSocket clients (SocketRocket on iOS / React Native) copy the URL port verbatim into the Host header, and some firewalls and proxies reject Host: ws-mt1.pusher.com:443 even though it is valid. Leave the port out when it equals the scheme default (443 for TLS, 80 otherwise). Explicitly configured non-default ports are unchanged. Claude-Session: https://claude.ai/code/session_016iDLS6rFN2quXXKim1T3qu
Author
|
Happy to discuss any changes, or questions |
pataar
marked this pull request as ready for review
September 8, 2026 13:20
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR description is generated by Claude. But the problem is a real occurring one on our React Native iOS case.
What does this PR do?
Connection URLs always include the port, e.g.
wss://ws-mt1.pusher.com:443/app/.... Some WebSocket clients copy an explicit URL port verbatim into theHostheader. SocketRocket (React Native on iOS) does this unconditionally (_SRHTTPConnectMessageHost), producingHost: ws-mt1.pusher.com:443. That is valid per RFC 9110 but redundant, and some firewalls and proxies reject it, so the handshake fails on iOS while browsers, which normalise default ports away, are fine.This drops the port from the URL when it equals the scheme default (443 for TLS, 80 otherwise) in
getGenericURL, the single place every transport URL (ws/wss/http/https/sockjs, all runtimes) is built. Explicitly configured non-default ports (wssPort: 1999, …) are unchanged.Existing specs asserting the default URLs were updated to the portless form. The custom-port specs already cover the "non-default port is kept" case.
Checklist
npm run formathas been runCHANGELOG
Hostheader (e.g. SocketRocket on iOS / React Native) no longer sendHost: host:443, which some firewalls and proxies reject