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
Copy file name to clipboardExpand all lines: README.md
+33-34Lines changed: 33 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,9 +3,9 @@
3
3
</p>
4
4
5
5
<h1align="center">OTG Code</h1>
6
-
<palign="center"><em>On-The-Go Code — a mobile-first terminal-based browser IDE for remote development</em></p>
6
+
<palign="center"><em>On-The-Go Code — a mobile-first, terminal-focused development environment in the browser</em></p>
7
7
8
-
<palign="center">Vibe code on your VPS or home machine from anywhere — phone, tablet, or desktop — with zero client-side installation. Full mobile-optimised terminal, file explorer, code editor, and localhost preview in a single browser tab, accessible via Cloudflare Quick Tunnels.</p>
8
+
<palign="center">Work on your VPS or home machine from anywhere — phone, tablet, or desktop — with zero client-side installation. A mobile-optimised terminal built for coding CLIs, with file explorer, code editor, and localhost proxy — all in a single browser tab, accessible via a single Cloudflare Quick Tunnel.</p>
Three panels — **Terminal**, **Files**, and **Browser** — responsive 3-column layout on desktop/landscape, single-panel with bottom tab bar on mobile/portrait (orientation-aware breakpoint). All panels stay mounted in the DOM with CSS visibility toggling, preserving terminal state, WebSocket connections, and iframe content across navigation. Everything routes through a single Cloudflare Quick Tunnel.
46
+
45
47
### Terminal
46
48
- Multi-session tabs (renamable), xterm.js with configurable font size
- Create, rename, delete files and folders; file info dialog; hidden files toggle
64
66
- Context menu (right-click / long-press), selectable/scrollable file paths
65
-
- Drag-and-drop file upload
66
-
67
-
### Viewers & Editors
68
-
-**Code Editor** — Monaco with syntax highlighting, configurable font size, word wrap
69
-
-**Markdown Preview** — GitHub-flavored with prose styling
70
-
-**Jupyter Notebook** — cells with type badges, rendered markdown, code, and outputs
71
-
-**HTML Preview** — live rendered in sandboxed iframe
72
-
-**PDF Viewer** — inline rendering with zoom and pinch-to-zoom
73
-
-**Image Viewer** — zoom controls with full pan/scroll at any zoom level, pinch-to-zoom
74
-
-**Video Player** — mp4, webm, ogg, mov, mkv, avi
75
-
-**Audio Player** — mp3, wav, ogg, flac, aac, m4a
76
-
77
-
### Layout & Access
78
-
-**Responsive** — 3-column resizable panels on desktop/landscape, single-panel with bottom tab bar on mobile/portrait (orientation-aware breakpoint)
79
-
-**Localhost Browser** — preview any localhost port via `/proxy/:port` reverse proxy (single tunnel, no per-port cloudflared processes), multi-tab with reachability checks
80
-
-**Cloudflare Tunnel** — one command (`./start.sh`) to build, start, and expose via public URL; all localhost previews route through the same tunnel
67
+
- Drag-and-drop file upload with progress tracking and per-file cancel
68
+
- Chunked upload for large files (>80 MB) to bypass Cloudflare's 100 MB request limit
69
+
-**Built-in viewers & editors:**
70
+
-**Code Editor** — Monaco with syntax highlighting, configurable font size, word wrap
71
+
-**Markdown Preview** — GitHub-flavored with prose styling
72
+
-**Jupyter Notebook** — cells with type badges, rendered markdown, code, and outputs
73
+
-**HTML Preview** — live rendered in sandboxed iframe
74
+
-**PDF Viewer** — inline rendering with zoom and pinch-to-zoom
75
+
-**Image Viewer** — zoom controls with full pan/scroll at any zoom level, pinch-to-zoom
76
+
-**Video Player** — mp4, webm, ogg, mov, mkv, avi
77
+
-**Audio Player** — mp3, wav, ogg, flac, aac, m4a
78
+
79
+
### Localhost Preview
80
+
-Preview any localhost port in a new tab via the built-in `/proxy/:port` reverse proxy
81
+
-Multi-tab port list with reachability checks and green/amber status indicators
82
+
-All localhost previews route through the same main tunnel of the app
81
83
82
84
## Quick Start
83
85
@@ -95,12 +97,12 @@ cp .env.example .env
95
97
./start.sh
96
98
```
97
99
98
-
The `start.sh` script installs dependencies if needed, builds the app, starts the server, and launches a Cloudflare Quick Tunnel — printing a public URL you can open on any device.
100
+
The `start.sh` script installs dependencies if needed, builds the app, starts the server, and launches a Cloudflare Quick Tunnel — printing a public URL you can open on any device. On macOS it also clears Gatekeeper quarantine flags on node-pty binaries. If `cloudflared` is not found in your PATH, the script auto-downloads it to `.bin/` (supports macOS, Linux, and Windows on x64/arm64).
99
101
100
102
<details>
101
-
<summary><strong>DNS tip:</strong> Tunnel URLs not resolving? Set your DNS to 1.1.1.1</summary>
103
+
<summary><strong>DNS tip:</strong> Tunnel URL not resolving? Set your DNS to 1.1.1.1</summary>
102
104
103
-
Quick tunnel URLs (e.g. `xxxx.trycloudflare.com`) resolve instantly on Cloudflare DNS but may take time on ISP/router DNS servers, or fail entirely if a stale NXDOMAIN gets cached. Set your DNS to **1.1.1.1** (Cloudflare) for instant resolution — it's faster and more reliable than most ISP DNS.
105
+
The Quick Tunnel URL (e.g. `xxxx.trycloudflare.com`) resolves instantly on Cloudflare DNS but may take time on ISP/router DNS servers, or fail entirely if a stale NXDOMAIN gets cached. Set your DNS to **1.1.1.1** (Cloudflare) for instant resolution.
104
106
105
107
**macOS:**
106
108
```bash
@@ -147,20 +149,17 @@ Express (port 7777)
147
149
├── Socket.IO — real-time terminal I/O via node-pty
└── Cloudflare Tunnel — single optional tunnel via cloudflared (all traffic, including localhost previews)
152
+
└── Cloudflare Tunnel — single optional tunnel via cloudflared (all traffic)
151
153
```
152
154
153
-
All three panels (Files, Terminal, Browser) are always mounted in the DOM with CSS visibility toggling — preserving terminal state, WebSocket connections, and iframe content across navigation.
154
-
155
-
### Localhost Preview
156
-
157
-
The Browser tab previews any localhost port through the Express reverse proxy — no extra tunnels or processes are spawned. When you enter a port, the UI checks reachability via `/proxy/:port/` and gives you a link to open in a new tab.
155
+
### Reverse Proxy
158
156
159
-
The proxy handles:
157
+
The `/proxy/:port` reverse proxy is how localhost previews work — no extra tunnels or processes needed. It handles:
160
158
-**Path rewriting** — strips the `/proxy/:port` prefix before forwarding to `127.0.0.1:<port>`
161
159
-**WebSocket upgrades** — WS connections on `/proxy/:port/...` are forwarded (supports Vite HMR, webpack-dev-server, etc.)
162
-
-**Header stripping** — removes `X-Frame-Options` and CSP headers so content can embed
163
-
-**Asset path rewriting** — rewrites absolute paths in HTML, CSS, JS (src, href, url(), ES imports) to include the `/proxy/:port` prefix
160
+
-**Header stripping** — removes `X-Frame-Options` and CSP headers so content can embed in the preview iframe
161
+
-**Asset path rewriting** — rewrites absolute paths in HTML, CSS, and JS (src, href, url(), ES imports) to include the `/proxy/:port` prefix so assets load correctly through the proxy
162
+
-**Port blocking** — blocks privileged ports (1–1023, except 80/443) and the OTG server port itself
164
163
165
164
**Dev server notes:** Most dev servers (Vite, webpack, Next.js) work out of the box since both HTTP and WebSocket traffic are proxied. However, dev servers that hardcode their WebSocket URL to `ws://localhost:<port>` in client-side code (bypassing the proxy path) will fail over the tunnel — the HMR connection won't reach the VPS. Vite works because its HMR client connects relative to the page origin. If a dev server's HMR breaks, configure it to use a relative or custom WebSocket path.
0 commit comments