@dpkrn/nodetunnel 1.0.9 → 1.0.10
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.
- package/README.md +34 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
# @dpkrn/nodetunnel
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Package **nodetunnel** exposes a local HTTP server on a public URL by establishing a persistent outbound TCP connection to a tunnel server.
|
|
4
|
+
|
|
5
|
+
It creates an outbound connection to a tunnel server and forwards incoming requests to your local application (e.g., `localhost:8080`).
|
|
6
|
+
|
|
7
|
+
From **Node.js**, you get a **public URL** for webhooks, demos, sharing a dev server, or testing from another device — without a separate tunnel daemon.
|
|
8
|
+
|
|
9
|
+
## Introduction
|
|
10
|
+
|
|
11
|
+
### Benefits
|
|
12
|
+
|
|
13
|
+
- Sharing your local server with others
|
|
14
|
+
- Testing webhooks (Stripe, GitHub, etc.)
|
|
15
|
+
- Remote debugging without deployment
|
|
16
|
+
- No port forwarding or firewall configuration needed
|
|
17
|
+
- Works behind NAT or private networks
|
|
18
|
+
- Simple integration with existing Node.js HTTP servers (Express, Fastify, plain `http`, etc.)
|
|
19
|
+
- Traffic inspector: capture traffic, replay, and modify requests as many times as you need
|
|
20
|
+
|
|
21
|
+
Incoming traffic reaches the public URL, is forwarded through the tunnel, and is proxied to your local HTTP server (e.g., `localhost:8080`).
|
|
22
|
+
|
|
23
|
+
This enables exposing local development servers without port forwarding, firewall changes, or public hosting.
|
|
24
|
+
|
|
25
|
+
### Requirements
|
|
26
|
+
|
|
27
|
+
- **Node.js 18+**
|
|
28
|
+
- A **tunnel server** must be running and reachable (configure `host` / `serverPort` — see **Options** under [API](#api) below).
|
|
29
|
+
- The port passed to `startTunnel` must match your local HTTP server port.
|
|
30
|
+
- Your local server must be running **before** or **concurrently** with `startTunnel`.
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
**nodetunnel** exposes a local HTTP server on a public URL by connecting to a tunnel server you run separately. Traffic hits the tunnel first, then your app on `localhost`.
|
|
4
35
|
|
|
5
36
|
---
|
|
6
37
|
|
|
@@ -13,14 +44,6 @@ Give your **local** HTTP server a **public URL** from Node.js — useful for web
|
|
|
13
44
|
|
|
14
45
|
---
|
|
15
46
|
|
|
16
|
-
## Requirements
|
|
17
|
-
|
|
18
|
-
- **Node.js 18+**
|
|
19
|
-
- Your app listening on a port (e.g. `8080`)
|
|
20
|
-
- A **tunnel server** reachable from your machine (default: `localhost:9000`)
|
|
21
|
-
|
|
22
|
-
---
|
|
23
|
-
|
|
24
47
|
## Install
|
|
25
48
|
|
|
26
49
|
```bash
|
|
@@ -129,7 +152,7 @@ server.listen(PORT, async () => {
|
|
|
129
152
|
});
|
|
130
153
|
|
|
131
154
|
// console.log("Public:", url);
|
|
132
|
-
// Open the Inspector URL from stderr in a browser (e.g. http://
|
|
155
|
+
// Open the Inspector URL from stderr in a browser (e.g. http://localhost:4040)
|
|
133
156
|
|
|
134
157
|
process.once("SIGINT", () => {
|
|
135
158
|
stop();
|
|
@@ -204,7 +227,7 @@ Errors **reject** the promise — use `try/catch`.
|
|
|
204
227
|
| `inspector` | `boolean` | `true` | If `true`, start the local traffic inspector UI (see [Traffic inspector](#traffic-inspector-local-dashboard)). If `false`, no extra HTTP server and no Inspector line in the banner. |
|
|
205
228
|
| `themes` | `string` | `'dark'` | Inspector palette: `'dark'`, `'terminal'`, or `'light'`. |
|
|
206
229
|
| `logs` | `number` | `100` | Maximum number of request/response captures kept in memory for the inspector. |
|
|
207
|
-
| `inspectorAddr` | `string` | `':4040'` | Listen address for the inspector (e.g. `':4040'`, `'
|
|
230
|
+
| `inspectorAddr` | `string` | `':4040'` | Listen address for the inspector (e.g. `':4040'`, `'localhost:9090'`). Display URL follows the same rules as the public banner. |
|
|
208
231
|
|
|
209
232
|
---
|
|
210
233
|
|