Skip to content

Use client-hostname by default - #352

Open
SevereOverfl0w wants to merge 1 commit into
bhauman:masterfrom
SevereOverfl0w:client-hostname-default
Open

Use client-hostname by default#352
SevereOverfl0w wants to merge 1 commit into
bhauman:masterfrom
SevereOverfl0w:client-hostname-default

Conversation

@SevereOverfl0w

Copy link
Copy Markdown

This is more likely to be correct, that you want to connect back to the same hostname you connected to the application on.

The binding hostname that was used otherwise is more likely to be an internal IP such as 0.0.0.0 which is not a valid way to access the web anymore.

Fix #351

This is more likely to be correct, that you want to connect back to the
same hostname you connected to the application on.

The binding hostname that was used otherwise is more likely to be an
internal IP such as 0.0.0.0 which is not a valid way to access the web
anymore.
@SevereOverfl0w
SevereOverfl0w force-pushed the client-hostname-default branch from 61909d5 to c99c76b Compare January 6, 2026 15:13
@bhauman

bhauman commented Mar 17, 2026

Copy link
Copy Markdown
Owner

Thanks for the PR! The 0.0.0.0 problem is real and worth fixing, but I'm not sure [[client-hostname]] is the right default here.

[[client-hostname]] resolves to js/location.hostname on the client. This breaks in a couple of scenarios:

  1. Sideloaded REPL — if figwheel's JS is loaded into a page served from a different server (e.g. your app on myapp.dev:3000, figwheel on localhost:9500), js/location.hostname gives you myapp.dev, not localhost, and the websocket connection fails.

  2. Node.js / React Native / Web Workersfill-url-template in figwheel-repl only resolves [[client-hostname]] when host-env is :html. For Node etc., the placeholder passes through as a literal string and the connection fails.

I think the narrower fix is to keep [[config-hostname]] as the default but translate 0.0.0.0 to localhost server-side in fill-connect-url-template, since 0.0.0.0 is a valid bind address but never a valid connect address.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

config-hostname is not a good default for :connect-url

2 participants