Repository navigation
WebSocket: bracket an IPv6 address in the Host header - #11
Open
dominicletz wants to merge 1 commit into
Open
dominicletz wants to merge 1 commit into
dominicletz wants to merge 1 commit into
Conversation
The handshake now sends `Host: [::1]:443`. RFC 3986 §3.2.2 requires the brackets: they tell the peer where the address ends and the port begins. Socket.Address.to_uri_host/1 adds them and prints the canonical form (RFC 5952). IPv4 addresses and host names come back unchanged.
This was referenced Nov 2, 2026
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.
Rebase of #10 onto the rebased UDP branch (#13), which sits on the rebased TCP/SSL branch (#12). The address-parser commit #10 was stacked on already landed as #7.
lib/socket/web.exmerged cleanly with the frame fixes from #6.The handshake sent
Host: ::1:443. RFC 3986 §3.2.2 requires the brackets, because that is how the peer tells the address from the port.Socket.Address.to_uri_host/1adds them and prints the canonical form (RFC 5952). IPv4 addresses and host names come back unchanged.Socket.Web.connect/3is the caller.The new handshake test connects to
"::1".Socket.Web.connect!/3dials throughSocket.TCP.connect!/3, so this depends on #12: without it the connect fails:nxdomainand the header is never sent. It does not use the UDP changes in #13; those sit underneath only sotest/ipv6_test.exsdoes not conflict between the two branches.Merge #12, then #13, then this.
mix teston this branch is 24 tests, 0 failures (Elixir 1.14.0 / OTP 25).mix format --check-formattedpasses, andmix compile --warnings-as-errorsis clean.Note
Low Risk
Localized change to Host header formatting in WebSocket connect; improves RFC compliance with no auth or data-path impact.
Reviewed by Cursor Bugbot for commit c0cfbe7. Configure here.