Title: Notifications only reach subscribers on the hostname used for the write · Issue #647 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Notifications only reach subscribers on the hostname used for the write · Issue #647 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Notifications only reach subscribers on the hostname used for the write · Issue #647 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary A WebSocket subscriber is only notified if it subscribed through the same hostname that the write came through. When one pod is reachable under two names, such as localhost and a LAN address, a write through one name doesn't noti...
Open Graph Description: Summary A WebSocket subscriber is only notified if it subscribed through the same hostname that the write came through. When one pod is reachable under two names, such as localhost and a LAN addres...
X Description: Summary A WebSocket subscriber is only notified if it subscribed through the same hostname that the write came through. When one pod is reachable under two names, such as localhost and a LAN addres...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/647
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Notifications only reach subscribers on the hostname used for the write","articleBody":"## Summary\n\nA WebSocket subscriber is only notified if it subscribed through the same hostname that the write came through. When one pod is reachable under two names, such as `localhost` and a LAN address, a write through one name doesn't notify tabs on the other, even though they're watching the same file.\n\nThis looks deliberate rather than a bug, because the hostname is part of a resource's identity and subdomain pods rely on it. This issue records the behaviour and asks whether JSS should change it.\n\n## What happens\n\n`getRequestPaths` in `src/handlers/resource.js` builds the change URL from the request hostname:\n\n```js\nconst resourceUrl = `${request.protocol}://${request.hostname}${urlPath}`;\n```\n\n`notifySubscribers` in `src/notifications/websocket.js` then looks up that exact string in `subscribers`. `checkSubscriptionAccess` also requires the subscribed URL's origin to match the socket's origin, so a client can't subscribe across names.\n\n## Test\n\nVersion 0.0.225, started with `--host 0.0.0.0`. One subscriber on each address, then the same file was uploaded once through each with PUT:\n\n| Upload through | `localhost` subscriber | `192.168.0.167` subscriber |\n|---|---|---|\n| `localhost` | Notified | Silent |\n| `192.168.0.167` | Silent | Notified |\n\nWe found this when a script uploaded through `localhost` while browser tabs, including one on another LAN machine, had the map open through the LAN address. The tabs only updated after a refresh.\n\nBehind a proxy this normally doesn't show, because the writer and readers all use the public name. A local writer behind a proxy would hit the same thing.\n\n## Other servers\n\nFrom reading the code, not running it:\n\n| Server | Matches on | Write on one name, subscriber on another | Trade-off |\n|---|---|---|---|\n| JSS | Full URL | Not notified | Writer and readers must share one name |\n| NSS (`solid-ws`) | Path only (`defaultToChannel`) | Notified | With subdomain pods, the same path on two pods looks like it would share a channel |\n| CSS | Full URL, one configured base URL | Other hosts get a 500 (`E0001`), unless `fixedBaseUrl` is set | One canonical name by configuration |\n\n## Options\n\n1. **Keep it and document it.** Writer and readers use the same address. This needs no code, and it's what we're doing for now.\n2. **Match on the storage path.** Key `subscribers` on what `getEffectiveUrlPath` returns, and send each socket the URL it subscribed with:\n\n | Request | Storage path |\n |---|---|\n | `localhost/public/x` | `/public/x` |\n | `192.168.0.167/public/x` | `/public/x` (same file, both notified) |\n | `alice.example.com/foo` | `/alice/foo` |\n | `bob.example.com/foo` | `/bob/foo` (different file, kept apart) |\n\n This hasn't been built or tested. The ancestor-container walk in `broadcast` and the ACL check on subscribe would need checking against it.\n\nEither way, it would help to mention this in the notifications section of `docs/configuration.md`, since going from `localhost` to `--host 0.0.0.0` is an easy way to run into it.\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-11-07T13:30:44Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/647"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a186a82-8192-b99a-23ce-e82f44f4b009 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 982E:3D4680:A385B7:D87217:6B03A679 |
| html-safe-nonce | d70c14773040768a6bb316ce338deff4aa686f1644a4cfb2b10af1f9487fa28a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5ODJFOjNENDY4MDpBMzg1Qjc6RDg3MjE3OjZCMDNBNjc5IiwidmlzaXRvcl9pZCI6IjY5MTMwNTA2ODg1MTE3ODA0NzMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | cf71d5f9e65bde654cb940b3639bee5a75c9d5d13b4f196e37cd2e2dcfc6afba |
| hovercard-subject-tag | issue:6259610163 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/JavaScriptSolidServer/JavaScriptSolidServer/647/issue_layout |
| twitter:image | https://opengraph.githubassets.com/bcb6eb3ee908f7895d10edc95c30b7686f7fa3ff51efab4bc1cea1ba4de754f2/JavaScriptSolidServer/JavaScriptSolidServer/issues/647 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/bcb6eb3ee908f7895d10edc95c30b7686f7fa3ff51efab4bc1cea1ba4de754f2/JavaScriptSolidServer/JavaScriptSolidServer/issues/647 |
| og:image:alt | Summary A WebSocket subscriber is only notified if it subscribed through the same hostname that the write came through. When one pod is reachable under two names, such as localhost and a LAN addres... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | melvincarvalho |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/JavaScriptSolidServer/JavaScriptSolidServer git https://github.com/JavaScriptSolidServer/JavaScriptSolidServer.git |
| octolytics-dimension-user_id | 205442424 |
| octolytics-dimension-user_login | JavaScriptSolidServer |
| octolytics-dimension-repository_id | 958025407 |
| octolytics-dimension-repository_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 958025407 |
| octolytics-dimension-repository_network_root_nwo | JavaScriptSolidServer/JavaScriptSolidServer |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width