You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reject malformed base paths such as //prefix before URL generation so the
client cannot drift onto a scheme-relative host.
Serve prefixed apps at /prefix/, redirect /prefix to that canonical route,
and set the manifest scope explicitly so the PWA entry, scope, and proxy
behaviour stay aligned.
Copy file name to clipboardExpand all lines: .agents/skills/remobi-setup/references/tailscale-serve.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,7 +26,7 @@ By default `remobi serve` binds to `127.0.0.1`, so it is not exposed on your LAN
26
26
tailscale serve --bg 7681
27
27
```
28
28
29
-
Your terminal is now available at `https://<your-machine>.<tailnet>.ts.net`.
29
+
Your terminal is now available at `https://<your-machine>.<tailnet>.ts.net`. If you publish remobi behind a path prefix instead of the root, start remobi with `--base-path /that-prefix` so the WebSocket and PWA URLs stay aligned with the external URL.
30
30
31
31
On mobile, tap **Add to Home Screen** for a standalone app experience with the remobi icon.
Copy file name to clipboardExpand all lines: docs/architecture/networking-and-websockets.md
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
# Networking and WebSocket flow
2
2
3
-
This page explains how a browser reaches remobi, how the `/ws` transport works, and how the shared terminal session stays in sync across clients.
3
+
This page explains how a browser reaches remobi, how the WebSocket transport works, and how the shared terminal session stays in sync across clients.
4
4
5
5
For the high-level runtime layout, see [How remobi works](how-remobi-works.md).
6
6
@@ -18,6 +18,8 @@ The browser talks to two server entry points:
18
18
-`GET /` for the HTML document with inline JS, CSS, config, and CSP nonce
19
19
-`GET /ws` for the terminal WebSocket
20
20
21
+
When `remobi serve --base-path /prefix` is used, remobi also serves the same HTML, WebSocket, manifest, and icon routes under `/prefix/...`. Root routes stay available for direct local access.
22
+
21
23
## Browser-to-session sequence
22
24
23
25
```mermaid
@@ -27,9 +29,9 @@ sequenceDiagram
27
29
participant Session as SharedTerminalSession
28
30
participant PTY as node-pty command
29
31
30
-
Browser->>Server: GET /
32
+
Browser->>Server: GET / or /prefix
31
33
Server-->>Browser: HTML + inline config + client bundle
32
-
Browser->>Server: GET /ws (upgrade)
34
+
Browser->>Server: GET /ws or /prefix/ws (upgrade)
33
35
Server->>Server: Validate Origin against Host
34
36
Server->>Session: addClient(client)
35
37
Note over Session,Browser: live output may race with snapshot
@@ -90,14 +92,14 @@ That is why the browser client has both snapshot handling and pending-output buf
90
92
91
93
The current server behaviour matters for docs because remobi is usually deployed behind another network layer:
92
94
93
-
-`/ws` upgrades are gated by an Origin check against the request Host header
95
+
-`/ws` upgrades, including prefixed variants such as `/prefix/ws`, are gated by an Origin check against the request Host header
94
96
- when no Origin is sent, loopback hosts are the only implicit allow case
95
97
- CSP `connect-src` is scoped to the request authority, including explicit `ws://` and `wss://` entries for Safari compatibility
96
98
- security headers are applied to both HTML and WebSocket-adjacent responses
97
99
98
100
## Client-side connection behaviour
99
101
100
-
The browser opens exactly one terminal socket to `${location.host}/ws`.
102
+
The browser opens exactly one terminal socket to `${location.host}${basePath}/ws`, where `basePath` is `/` by default and can be overridden with `--base-path`.
101
103
102
104
- before the socket opens, outbound messages are queued locally
103
105
- on open, the client sends a resize based on the fitted terminal size, then flushes queued messages
0 commit comments