Add opt-in BACKEND_HOST knob for network-wide backend bind - #28
Open
dokterbob wants to merge 1 commit into
Open
Conversation
The backend defaults to loopback-only (matches prior behavior). Setting BACKEND_HOST=0.0.0.0 makes it reachable from other machines and now prints a clear warning, since neither backend variant has auth enabled in this demo. The frontend was already reachable from other machines with no code change; the closing summary now surfaces its external URL when BACKEND_HOST is opted in. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
127.0.0.1), matching current behavior — default runs are unaffected.BACKEND_HOSTenv var (mirrors the existingsend_request.shnaming) lets you bind the backend wide, e.g.BACKEND_HOST=0.0.0.0 ./scripts/serve.sh.local_backend.pyon Linux,local_backend_mac.pywrappingbackend/server.pyon macOS) has auth enabled in this demo.-His omitted) — added a comment near its launch so this isn't "fixed" by accident later.host_ip()helper incommon.sh), gated behind the opt-in so default output is byte-for-byte unchanged.Test plan
sh -n scripts/serve.sh/sh -n scripts/common.sh— syntax OK./scripts/serve.shwith no overrides — no warning, no network-access section, backend binds127.0.0.1:8000BACKEND_HOST=0.0.0.0 ./scripts/serve.sh— warning prints,lsofshows*:8000, summary prints resolved network URLsBACKEND_HOST=localhost/BACKEND_HOST=::1— no warning, no network-access sectionBACKEND_HOST=<host-IP> ./scripts/send_request.sh -p "..."against a wide-bound backend🤖 Generated with Claude Code