Skip to content

fix(client): rewrite wildcard service URLs to loopback - #49805

Closed
cestercian wants to merge 1 commit into
anomalyco:devfrom
cestercian:fix/49796-service-wildcard-loopback
Closed

cestercian wants to merge 1 commit into
anomalyco:devfrom
cestercian:fix/49796-service-wildcard-loopback

Conversation

@cestercian

Copy link
Copy Markdown
Contributor

Issue for this PR

Fixes #49796

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

When the service registers as http://0.0.0.0:<port> (or IPv6 ::), CLI clients probed that URL verbatim. With an HTTP proxy set and the wildcard not in no_proxy, the proxy answered 502 and the service looked unhealthy.

This change adds shared loopbackURL() and uses it for Effect/Promise probes, baseUrl, PTY handoff, and desktop connect so local clients hit 127.0.0.1 / ::1. Registration can still advertise the wildcard for LAN/opencode pair.

How did you verify your code works?

From packages/client:

  • bun test test/service-url.test.ts test/service.test.ts test/promise-service.test.ts — 31 pass
  • bun typecheck (client/desktop/cli); pre-push turbo typecheck passed

Screenshots / recordings

N/A — client URL rewrite covered by unit tests.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Probe and connect through 127.0.0.1/::1 when the registration advertises
0.0.0.0 or :: so HTTP proxies cannot intercept local CLI clients.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for your contribution!

This PR doesn't have a linked issue. All PRs must reference an existing issue.

Please:

  1. Open an issue describing the bug/feature (if one doesn't exist)
  2. Add Fixes #<number> or Closes #<number> to this PR description

See CONTRIBUTING.md for details.

@github-actions

Copy link
Copy Markdown
Contributor

The following comment was made by an LLM, it may be inaccurate:

@github-actions

Copy link
Copy Markdown
Contributor

Automated PR Cleanup

Thank you for contributing to opencode.

Due to the high volume of PRs from users and AI agents, we periodically close older PRs using automated criteria so maintainers can focus review time on the most active and community-supported contributions.

This PR was closed because it matched the following cleanup criteria:

  • The PR was created more than 1 month ago
  • The PR had fewer than 2 positive reactions
  • Positive reactions are counted as thumbs-up, heart, celebration, or rocket reactions on the PR

PRs created within the last month are not affected by this cleanup.

If you believe this PR was closed incorrectly, or if you are still actively working on it, please leave a comment explaining why it should be reopened. A maintainer can review and reopen it if appropriate.

Thanks again for taking the time to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cli: service configured with hostname 0.0.0.0 is unreachable when an HTTP proxy is set

1 participant