fix: bind vs browser URL handling for remote access#159
Merged
vakovalskii merged 1 commit intovakovalskii:mainfrom Apr 10, 2026
Merged
fix: bind vs browser URL handling for remote access#159vakovalskii merged 1 commit intovakovalskii:mainfrom
vakovalskii merged 1 commit intovakovalskii:mainfrom
Conversation
apstenku123
added a commit
to apstenku123/codedash
that referenced
this pull request
Apr 11, 2026
- vakovalskii#155 clipboard copy fallback on non-secure origins (execCommand shim) - vakovalskii#156 star button sync in detail panel (already applied earlier) - vakovalskii#159 bind address vs browser URL separation (execFile, safer) - ca70fd2 dual metrics: user_messages (real) + total_interactions (all) - d3f4326 Node >= 18 version check at startup with clear error Skipped: vakovalskii#100 Warp launch config (non-iTerm2), vakovalskii#157 session name refactor (too many touches), vakovalskii#160 badge display config (non-critical), analytics totalSessionsAll (already have similar in createCostAggregator).
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.
Picked from #37
This PR fixes startup URL handling when CodeDash is configured to listen on a non-localhost bind address such as
0.0.0.0.From the user point of view, the issue was confusing startup output in remote-access setups. CodeDash could be listening correctly, but the printed address mixed together two different concerns:
This change separates those two concepts explicitly. The server still binds to the requested host, while the startup output and browser-facing URL stay usable for the machine that launched CodeDash.
Why this change is needed
In remote-access mode, users can intentionally start CodeDash with a wildcard or non-localhost bind host so that other devices on the local network can reach it.
Before this fix, the startup path reused the bind host too broadly. That created two practical problems:
0.0.0.0are valid forserver.listen(...)but are not the right host to present as a browser URLFor users, that means CodeDash can appear misconfigured even when it is working. The app is listening correctly, but the displayed/opened URL is not the most usable or least surprising one.
Root cause
The startup logic treated the configured host as if it were a single canonical address for all purposes.
That assumption is wrong for wildcard bind hosts:
0.0.0.0,::, and similar values are valid bind targetsThere was also coupling between the bind host and the base URL used for request URL parsing, even though that base is only a helper for parsing relative request paths and does not need to reflect the listen host.
What changed
getBrowserUrl()/getBrowserHost()server.listen(...)on the actual bind addresslocalhostfor display/open behaviorexecFile(...)for browser launch so the URL is passed as an argument instead of through a shell command stringWhy this does not break anything
0.0.0.0still means "listen on all interfaces".execFile(...)does not change intended behavior for opening the browser. It just uses the more appropriate process-spawn primitive for a fixed command plus arguments.User impact
Before:
After:
localhostfor local browser useVerification
CODEDASH_HOST=0.0.0.0bind 0.0.0.0:<port>http://localhost:<port>Listening on all interfaceslocalhost:<port>