Title: Tunnel client mode: jss --tunnel-connect to dial out to an existing relay (expose a pod behind NAT/mobile) · Issue #527 · JavaScriptSolidServer/JavaScriptSolidServer · GitHub
Open Graph Title: Tunnel client mode: jss --tunnel-connect to dial out to an existing relay (expose a pod behind NAT/mobile) · Issue #527 · JavaScriptSolidServer/JavaScriptSolidServer
X Title: Tunnel client mode: jss --tunnel-connect to dial out to an existing relay (expose a pod behind NAT/mobile) · Issue #527 · JavaScriptSolidServer/JavaScriptSolidServer
Description: Summary Add a tunnel client mode so a JSS pod can dial out to an existing JSS relay and be exposed publicly — the inverse of the relay we already ship. src/tunnel/index.js (tunnelPlugin, enabled by jss start --tunnel) is the relay/server...
Open Graph Description: Summary Add a tunnel client mode so a JSS pod can dial out to an existing JSS relay and be exposed publicly — the inverse of the relay we already ship. src/tunnel/index.js (tunnelPlugin, enabled by...
X Description: Summary Add a tunnel client mode so a JSS pod can dial out to an existing JSS relay and be exposed publicly — the inverse of the relay we already ship. src/tunnel/index.js (tunnelPlugin, enabled by...
Opengraph URL: https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/527
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tunnel client mode: jss --tunnel-connect to dial out to an existing relay (expose a pod behind NAT/mobile)","articleBody":"## Summary\n\nAdd a **tunnel client** mode so a JSS pod can dial *out* to an existing JSS relay and be exposed publicly — the inverse of the relay we already ship.\n\n`src/tunnel/index.js` (`tunnelPlugin`, enabled by `jss start --tunnel`) is the **relay/server** half: it accepts WebSocket clients at `wss://\u003cpod>/.tunnel`, proxies public HTTP (`https://\u003cpod>/tunnel/{name}/…`) down the socket, and relays responses back. Registration is WebID-authenticated and the wire protocol is fully specified in the file header.\n\nWhat's missing is the **client** half: a mode (e.g. `jss start --tunnel-connect wss://\u003crelay>/.tunnel --tunnel-name \u003cname>`) where, after the local pod is listening, JSS opens an outbound WS to the relay, registers, and forwards each proxied request to its own `http://localhost:\u003cport>`.\n\n## Why\n\n- Exposes a pod behind CGNAT / on mobile (no public IP, no port-forwarding) — it's a single **outbound** connection.\n- The public URL is **HTTPS** (a secure context), which retires the localhost-only + mixed-content/`crypto.subtle` constraints that currently force same-origin-only sign-in (see js-pod/android #5/#6). External Solid apps could then reach a phone-hosted pod.\n- Operator already runs a JSS `--tunnel` relay in the cloud; only the client is needed to connect to it.\n\n## Scope (the client)\n\nAgainst the protocol already defined in `src/tunnel/index.js`:\n\n1. Open a WS to the relay's `/.tunnel` (with auth — see below).\n2. Send `register` with a name → receive the registered public path.\n3. On each `request` frame (`{ id, method, path, headers, body }`) → `fetch('http://localhost:\u003cpodport>' + path, …)` against the local pod → reply with a `response` frame (`{ id, status, headers, body }`).\n4. Reconnect with backoff (mobile networks flap); re-register on reconnect.\n5. New option(s): `--tunnel-connect \u003cwss-url>`, `--tunnel-name \u003cname>`, plus the auth credential.\n\n## Open questions\n\n- **Relay auth for the client.** `/.tunnel` requires a WebID today (`getWebIdFromRequestAsync` on the upgrade). The outbound client needs a credential the relay accepts:\n - **Pre-shared tunnel token** configured on both ends — simplest for a self-hosted relay; likely needs a small relay-side addition to accept it.\n - **Solid-OIDC token** — client authenticates to the relay's IdP and presents the bearer. Cleaner, more moving parts.\n- **Path vs subdomain.** Relay is path-based today (`/tunnel/\u003cname>/`), so the tunneled pod's WebID becomes `https://\u003crelay>/tunnel/\u003cname>/profile/card#me` — works for reachability but trips Solid apps that assume a root-hosted pod. Subdomain (`https://\u003cname>.\u003crelay>/`) is cleaner for identity but needs wildcard DNS + TLS on the relay.\n- **Stable name** so the public URL / WebID / issuer doesn't churn between sessions.\n\n## Notes\n\n- Mobile lifecycle: the tunnel lives only while the pod runs — fine on Android (foreground service keeps it alive), not viable on iOS (background limits).\n- Relay half is done; this is a focused, additive client. Pairs with the embeddable in-process work in JavaScriptSolidServer/jspod#58.\n","author":{"url":"https://github.com/melvincarvalho","@type":"Person","name":"melvincarvalho"},"datePublished":"2026-05-24T14:00:00Z","url":"https://github.com/JavaScriptSolidServer/JavaScriptSolidServer/issues/527"}
| 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:f9d05c39-bb5a-f0e3-bebf-db582bdfed5c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D008:3D4AFB:89DC9C:AED7D8:6B039F1E |
| html-safe-nonce | 353375f1cdb39f0c5a68e8dff72eea8f0352f7425a42b9287d9fabbf214a9a68 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEMDA4OjNENEFGQjo4OURDOUM6QUVEN0Q4OjZCMDM5RjFFIiwidmlzaXRvcl9pZCI6IjU5MjU4Mjg3NDMwMTE3MzczNzQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 24728bd96af45a5fdf4f5ef4aa44ad4c6d0d3a2aec205769a710334d0a5da14d |
| hovercard-subject-tag | issue:4511828650 |
| 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/527/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8f31124814f847863eb19396d21cd8bf03790a8cf41ddbcff786a65528565d41/JavaScriptSolidServer/JavaScriptSolidServer/issues/527 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8f31124814f847863eb19396d21cd8bf03790a8cf41ddbcff786a65528565d41/JavaScriptSolidServer/JavaScriptSolidServer/issues/527 |
| og:image:alt | Summary Add a tunnel client mode so a JSS pod can dial out to an existing JSS relay and be exposed publicly — the inverse of the relay we already ship. src/tunnel/index.js (tunnelPlugin, enabled by... |
| 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