fix: use localhost instead of 127.0.0.1 in local-node browser links#58
Merged
Conversation
The "Open River & Join Chat" invite button and the Ghost Key "Import to Freenet" button hand the browser a literal http://127.0.0.1:7509/ URL pointing at the user's local Freenet node. On Windows this fails with "can't access this site"; replacing 127.0.0.1 with localhost works. Root cause: since the dual-stack change (freenet-core #3648), the node binds its local HTTP/WS API on the IPv6 loopback by default (::1 in local mode, :: in network mode) with IPV6_V6ONLY=false. On Linux the dual-stack socket also accepts IPv4-mapped connections, so 127.0.0.1 works there. On Windows that path is unreliable and the socket is effectively IPv6-only for inbound, so the literal IPv4 address is refused while "localhost" (which Windows resolves to ::1) connects. Using localhost is correct on every platform: the browser resolves it to whichever loopback the node is actually listening on. River's UI derives its WebSocket URL from window.location.host, so loading the page from localhost:7509 makes the follow-on WS connection use localhost too. Reported via gigazine.net's River writeup, where the author had to edit 127.0.0.1 to localhost by hand to reach the chat on Windows. Co-Authored-By: Claude Opus 4.8 (1M context) <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.
Problem
The "Open River & Join Chat" invite button (
river-invite-button.html) and the Ghost Key "Import to Freenet" button (donation-success.js) hand the browser a literalhttp://127.0.0.1:7509/URL pointing at the user's local Freenet node.On Windows, opening this URL fails with "can't access this site." Replacing
127.0.0.1withlocalhostmakes it work. This was reported in gigazine.net's River writeup, where the author had to hand-edit127.0.0.1→localhostto reach the official chat room.Root cause
Since the dual-stack change (freenet-core #3648), the node binds its local HTTP/WS API on the IPv6 loopback by default (
::1in local mode,::in network mode) withIPV6_V6ONLY=false.127.0.0.1works.localhost(which Windows resolves to::1) connects.Approach
Use
localhostrather than the literal127.0.0.1for the two browser-facing links.localhostis correct on every platform: the browser resolves it to whichever loopback the node is actually listening on. River's UI derives its WebSocket URL fromwindow.location.host(ui/src/components/app/freenet_api/constants.rs), so loading the page fromlocalhost:7509makes the follow-on WS connection uselocalhosttoo — the fix propagates without any River change.Scope / not changed
publish-a-website.mdshows literalfdevterminal output (Website URL: http://127.0.0.1:7509/...) and documentsfdev's default connection. Changing the docs would misrepresent what the tool prints — the proper fix is infdev/freenet-core.install.shdashboard message is the Unixcurl | shinstaller (Windows users don't run it;127.0.0.1works on Linux).remote-access.md127.0.0.1references are SSH-tunnel/config context and correct as-is.127.0.0.1and::1) — or reverting the loopback default to IPv4 on Windows — would make the literal IPv4 address work again. Tracked separately; this PR resolves the user-visible symptom for the website's links.Testing
node --checkpasses ondonation-success.js.localhostpropagates to the WebSocket connection.main) and not gated by CI; left untouched to keep the diff minimal.[AI-assisted - Claude]
🤖 Generated with Claude Code