Repository navigation
Add IPv6 support via inet_family - #149
Merged
Merged
Conversation
Hostnames stay on IPv4 unless inet_family: :inet6 is set. Address literals select their own family, and a proxy uses the family of the proxy host. The WebSocket Host header brackets IPv6 literals, and a TLS upgrade through a proxy does not send an IP address as SNI. Co-authored-by: dominic.letz <dominic.letz@berlin.de>
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.
Hostnames stay on IPv4.
inet_family: :inet6dials them over IPv6. An address literal selects its own family, sows://[::1]:8080/wsdoes not need the option.The family is the family of the socket that is opened. With an HTTP CONNECT proxy, that is the proxy host, not the WebSocket target. A family that disagrees with a literal address is an error from
WebSockex.Conn.new/2.:socket_optionscannot carry this. Those options go throughKeyword.merge/2, which rejects the bare:inet6atom OTP expects, so the family is inserted beside that list and shared by direct TCP, TLS, and the proxy dial.Also brackets IPv6 literals in the WebSocket
Hostheader ([::1]:port), and does not send an IP address as SNI when a proxiedwss://connection is upgraded.This replaces #139, which was based on the tree from November 2025 and could not be rebased onto the TLS verification and proxy changes. The new tests connect to a
::1listener and read the peer address, and they are skipped only when that listen returns:eafnosupportor:eaddrnotavail.Note
Medium Risk
Changes how sockets are opened for direct, TLS, and proxied paths, including SNI on tunnel upgrades, though defaults stay IPv4 and behavior is heavily tested.
Reviewed by Cursor Bugbot for commit 52cdd5a. Configure here.