fix(code-server): stop pinning both address families on 8080 - #208
Draft
robmry wants to merge 1 commit into
Draft
Conversation
3 tasks
robmry
force-pushed
the
fix/code-server-default-port-protocol
branch
from
August 17, 2026 12:54
1525e20 to
368ed4d
Compare
code-server binds 0.0.0.0:8080 inside the sandbox — IPv4 only — while the kit pinned `protocol: tcp`, which asks for both address families. A host client whose resolver answers `localhost` with ::1 first therefore reached the sandbox over IPv6, where nothing was listening, and had its connection accepted and then reset: a dead end no client recovers from, unlike a refusal. Omit the protocol instead, so the consumer decides which families to publish and the kit never asks for one this service cannot serve. The spec accepts only "", "tcp" and "udp", so omitting the field is the only way to stop demanding both. This is safe to land ahead of any consumer change. A consumer that resolves an empty protocol to dual-stack `tcp` reproduces exactly the behaviour the pinned value had, so nothing regresses for anyone running one today; a consumer that resolves it to a single family fixes the dead end, and the kit picks that up with no further edit. The spec's own documentation asserted an equivalence between an empty protocol and "tcp". Since the same spec is read by consumers that publish one family and consumers that publish both, `spec/types.go` and the `SPEC-v2.md` example now describe the contract — empty defers to the consumer, naming a protocol asks for both families — without claiming what any particular consumer does. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Rob Murray <rob.murray@docker.com>
robmry
force-pushed
the
fix/code-server-default-port-protocol
branch
from
August 17, 2026 13:05
368ed4d to
48b6fa0
Compare
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.
tcp4(for sbx v0.40)code-serverrunscode-server --bind-addr 0.0.0.0:8080inside the sandbox — IPv4 only — while the kit pinnedprotocol: tcp, which publishes both address families. On a host whose resolver answerslocalhostwith::1first, openinghttp://localhost:<port>/therefore reached the sandbox over IPv6, where nothing was listening, and the connection was accepted and then reset. That is a dead end no client recovers from, unlike a refusal, and it is the exact complaint behind docker/sbx-releases#342.docker/sandboxes#4994 addresses that consumer-side, by publishing a single address family when no protocol is named — but a kit that spells out
protocol: tcpopts back out of it, so this kit would keep the broken behaviour. Since the spec accepts only"","tcp"and"udp"(until #163 is merged), omitting the field is how a kit stops demanding both, so the line is dropped and a comment records why it must stay dropped.Safe to land before the consumer change ships
This kit goes live on merge, while docker/sandboxes#4994 is not in a release yet. Both cases are fine:
tcpreproduces exactly what the pinned value did, so nothing regresses for anyone running one today;That is also why none of the comments here name a version or state what the default is: the same spec is read by consumers on both sides of that change.
Spec documentation
The spec asserted an equivalence between an empty protocol and
tcpin two places. Both now describe the contract instead — empty defers to the consumer, naming a protocol asks for both families and so needs a service listening on IPv6 — without claiming what any particular consumer does:spec/types.goonPublishedPort.Protocolports:example inspec/SPEC-v2.mdThe validation rule is unchanged:
protocolis still one of"",tcp,udp.Other kits
I checked every kit that declares ports.
codex-app-serveralso pinsprotocol: tcp, for sshd on 22 — left alone deliberately, since sshd listens on both families by default, so dual-stack publishing is correct there.nanoclawomits the protocol already and picks up the new default with no change.🤖 Raised by Claude Code on behalf of @robmry.