Skip to content

fix(client): use 127.0.0.1:8888 as default server address - #2536

Merged
tkircsi merged 1 commit into
agntcy:mainfrom
jay23606:pr-go/2531-bug-default-client-address-0-0-0-0-8888-
Nov 24, 2026
Merged

tkircsi merged 1 commit into
agntcy:mainfrom
jay23606:pr-go/2531-bug-default-client-address-0-0-0-0-8888-

Conversation

@jay23606

Copy link
Copy Markdown
Contributor

Problem

client.DefaultServerAddress was 0.0.0.0:8888. That is a bind address, not a dial address. Linux and macOS happen to treat a connect to 0.0.0.0 as loopback, but Windows fails with WSAEADDRNOTAVAIL. As a result, a Windows user who runs a local daemon and omits --server-addr, DIRECTORY_CLIENT_SERVER_ADDRESS and a context cannot connect.

Change

  • client/config.go: DefaultServerAddress is now 127.0.0.1:8888. It behaves the same on macOS and Linux and works on Windows.
  • client/options_test.go: TestOptions_DefaultValues now expects 127.0.0.1:8888. This is the regression test. It fails on the old value with expected: "127.0.0.1:8888" and passes with the fix.
  • client/README.md and docs/content/dir/dir-sdk-go.md: the documented default for DIRECTORY_CLIENT_SERVER_ADDRESS is updated to match.

Testing

  • go test ./ -run TestOptions_DefaultValues -count=1 in client/: fails with the old value, passes with the fix.
  • go vet ./ in client/: no output.
  • go test ./... -count=1 in client/: all packages pass.

The Windows connection itself was not run on a Windows host here; the fix relies on the documented connect behaviour for 0.0.0.0.

Regression test: fails on base twice (/expected: "127.0.0.1:8888"/), passes on fix twice (cd client && go test ./ -run '^TestOptions_DefaultValues$' -count=1)

Fixes #2531

@jay23606
jay23606 requested a review from a team as a code owner November 23, 2026 23:52
@github-actions github-actions Bot added the size/XS Denotes a PR that changes 0-49 lines label Nov 23, 2026
@codecov

codecov Bot commented Nov 24, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@tkircsi tkircsi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jay23606 for the clear writeup. 0.0.0.0 is a bind address, and dialing it works on Linux and macOS only by BSD convention. The daemon already maps an unspecified host to 127.0.0.1 before dialing itself (localDialAddress in cli/cmd/daemon/config.go), so this just brings the client default in line.

@tkircsi
tkircsi added this pull request to the merge queue Nov 24, 2026
Merged via the queue into agntcy:main with commit ca5f650 Nov 24, 2026
37 checks passed
@jay23606
jay23606 deleted the pr-go/2531-bug-default-client-address-0-0-0-0-8888- branch November 25, 2026 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Denotes a PR that changes 0-49 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Default client address 0.0.0.0:8888 cannot work on Windows

2 participants