localhostforonline 1.0.8 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +58 -10
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -50,6 +50,7 @@ Monitor every request in real time:
50
50
  - Request count, methods, paths, status codes
51
51
  - Response time and bandwidth
52
52
  - Full request history per tunnel
53
+ - Expandable request headers and response body
53
54
 
54
55
  [Access the dashboard](https://localhostfor.online/dashboard)
55
56
 
@@ -72,30 +73,76 @@ Even without an account, anyone with a tunnel URL can view its request history:
72
73
  https://localhostfor.online/dashboard?token=<project-id>
73
74
  ```
74
75
 
76
+ ### 🌐 Protocol support
77
+
78
+ | Protocol | How | Example |
79
+ |----------|-----|---------|
80
+ | **HTTP** (default) | All methods (GET, POST, PUT, DELETE, etc.) | `npx localhostforonline tunnel --port 3000` |
81
+ | **WebSocket** | Auto-detected via `Upgrade: websocket` header | Same command — no extra flags |
82
+ | **TCP** | Dedicated TCP port for raw byte relay | `npx localhostforonline tunnel --port 3000 --tcp` |
83
+
75
84
  ---
76
85
 
77
86
  ## CLI usage
78
87
 
79
88
  ```bash
80
- localhostforonline tunnel --port <port> # Expose a local port
81
- localhostforonline tunnel --port 3000 --api-key x # Link to your account
82
- localhostforonline register # Generate an auth token
83
- localhostforonline login <token> # Save auth token
89
+ # HTTP / WebSocket (auto-detected)
90
+ npx localhostforonline tunnel --port 3000
91
+
92
+ # TCP forwarding
93
+ npx localhostforonline tunnel --port 22 --tcp
94
+
95
+ # Link to your account
96
+ npx localhostforonline tunnel --port 3000 --api-key lf_sk_xxx
97
+
98
+ # Rewrite Host header (for virtual hosts)
99
+ npx localhostforonline tunnel --port 3000 --host-header rewrite
100
+
101
+ # Generate an auth token
102
+ npx localhostforonline register
103
+
104
+ # Save your auth token
105
+ npx localhostforonline login <token>
84
106
  ```
85
107
 
86
108
  ### Options
87
109
 
88
- | Flag | Description |
89
- |------|-------------|
90
- | `--port` | Local port to expose |
91
- | `--api-key` | API key to link tunnel to your account |
92
- | `--url` | Full local URL (alternative to --port) |
110
+ | Flag | Type | Default | Description |
111
+ |------|------|---------|-------------|
112
+ | `--port` | int | — | Local port to expose |
113
+ | `--url` | string | | Full local URL (alternative to --port) |
114
+ | `--api-key` | string | | API key to link tunnel to your account |
115
+ | `--host-header` | string | `""` | Rewrite Host header (`rewrite` = set to `localhost:<port>`) |
116
+ | `--tcp` | bool | `false` | Enable TCP forwarding (allocates a dedicated port) |
117
+
118
+ ### Output format
119
+
120
+ ```
121
+ Tunnel created!
122
+ ✓ Your URL: https://localhostfor.online/project-abc123
123
+ ✓ Local: localhost:3000
124
+ ✓ Dashboard: https://localhostfor.online/dashboard?token=abc123
125
+ ✓ TCP Port: 20000 (only when using --tcp)
126
+ Press Ctrl+C to stop
127
+ ```
128
+
129
+ ### TCP forwarding
130
+
131
+ When using `--tcp`, the server allocates a dedicated TCP port. Connect by sending the project ID (36 bytes) first, then your raw data:
132
+
133
+ ```bash
134
+ # Example: expose SSH
135
+ npx localhostforonline tunnel --port 22 --tcp
136
+
137
+ # In another terminal:
138
+ (printf '<project-uuid>'; cat) | nc localhostfor.online 20000
139
+ ```
93
140
 
94
141
  ### Environment variables
95
142
 
96
143
  | Variable | Default | Description |
97
144
  |----------|---------|-------------|
98
- | `LOCALHOSTFOR_SERVER` | `localhostfor.online` | Server URL for local development |
145
+ | `LOCALHOSTFOR_SERVER` | `localhostfor.online` | Server URL for local development / self-hosting |
99
146
 
100
147
  ---
101
148
 
@@ -105,6 +152,7 @@ localhostforonline login <token> # Save auth token
105
152
  [https://localhostfor.online](https://localhostfor.online)
106
153
 
107
154
  Endpoints:
155
+ - `/` — Landing page with documentation and quick start
108
156
  - `/dashboard` — Tunnel list and request history
109
157
  - `/dashboard?token=<id>` — Request log for a specific tunnel
110
158
  - `/login` — Sign in with WhatsApp to get an API key
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "localhostforonline",
3
- "version": "1.0.8",
3
+ "version": "1.0.9",
4
4
  "description": "Expose your localhost to the internet",
5
5
  "bin": {
6
6
  "localhostforonline": "cli.js"