Skip to content

Support IPv4-only, IPv6-only, and dual-stack hosts#14

Merged
andreterroir merged 1 commit into
mainfrom
claude/magical-darwin-ER4eW
Jun 2, 2026
Merged

Support IPv4-only, IPv6-only, and dual-stack hosts#14
andreterroir merged 1 commit into
mainfrom
claude/magical-darwin-ER4eW

Conversation

@andreterroir

Copy link
Copy Markdown
Owner

The server and example client both hardcoded the IPv6 loopback literal
::1:8080, which only works on hosts with an IPv6 stack and only over
loopback.

Server: bind the IPv6 wildcard (::), which on dual-stack Linux hosts is a
dual-stack socket accepting both IPv6 and IPv4-mapped clients, and fall
back to the IPv4 wildcard (0.0.0.0) when the host has no IPv6 stack.

Client: resolve the host name via std's HostName.connect, letting the
standard library race IPv6 and IPv4 candidates (Happy Eyeballs). On
dual-stack hosts IPv6 is attempted first; IPv4-only hosts fall back
transparently.

The server and example client both hardcoded the IPv6 loopback literal
::1:8080, which only works on hosts with an IPv6 stack and only over
loopback.

Server: bind the IPv6 wildcard (::), which on dual-stack Linux hosts is a
dual-stack socket accepting both IPv6 and IPv4-mapped clients, and fall
back to the IPv4 wildcard (0.0.0.0) when the host has no IPv6 stack.

Client: resolve the host name via std's HostName.connect, letting the
standard library race IPv6 and IPv4 candidates (Happy Eyeballs). On
dual-stack hosts IPv6 is attempted first; IPv4-only hosts fall back
transparently.
@andreterroir andreterroir merged commit 43cdac5 into main Jun 2, 2026
1 check passed
@andreterroir andreterroir deleted the claude/magical-darwin-ER4eW branch June 2, 2026 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants