portprism 2.0.3 โ 2.0.5
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 +144 -0
- package/dist/index.js +557 -107
- package/package.json +22 -6
- package/dist/__tests__/inspector.test.d.ts +0 -2
- package/dist/__tests__/inspector.test.d.ts.map +0 -1
- package/dist/__tests__/inspector.test.js +0 -80
- package/dist/__tests__/inspector.test.js.map +0 -1
- package/dist/agent.d.ts +0 -78
- package/dist/agent.d.ts.map +0 -1
- package/dist/agent.js +0 -357
- package/dist/agent.js.map +0 -1
- package/dist/authStore.d.ts +0 -14
- package/dist/authStore.d.ts.map +0 -1
- package/dist/authStore.js +0 -34
- package/dist/authStore.js.map +0 -1
- package/dist/config.d.ts +0 -13
- package/dist/config.d.ts.map +0 -1
- package/dist/config.js +0 -32
- package/dist/config.js.map +0 -1
- package/dist/display.d.ts +0 -37
- package/dist/display.d.ts.map +0 -1
- package/dist/display.js +0 -113
- package/dist/display.js.map +0 -1
- package/dist/index.d.ts +0 -3
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/inspector.d.ts +0 -58
- package/dist/inspector.d.ts.map +0 -1
- package/dist/inspector.js +0 -328
- package/dist/inspector.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
# PortPrism
|
|
2
|
+
|
|
3
|
+
**Share your local dev server with anyone, instantly.** Point PortPrism at a local
|
|
4
|
+
port and you get a clean, branded **HTTPS** URL that anyone can open in a browser โ no
|
|
5
|
+
account, no config, and nothing for your viewers to install.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx portprism 3000
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- ๐ **Instant public URL** for any local HTTP server
|
|
12
|
+
- ๐ฅ๏ธ **Branded viewer** โ recipients see your app, not a tunnel warning page
|
|
13
|
+
- ๐ **TLS end-to-end**; optional password protection (Pro)
|
|
14
|
+
- ๐ **Auto-reconnect** โ brief network drops recover on the same URL
|
|
15
|
+
- ๐ฑ **QR code** for quick mobile testing (`--qr`)
|
|
16
|
+
- ๐ **Request inspector** (`--inspect`) โ a local ledger of tunnelled HTTP traffic for webhook/API debugging
|
|
17
|
+
- ๐ค **MCP server** so AI agents can launch and manage tunnels
|
|
18
|
+
- โ๏ธ **`--json`** NDJSON output for scripts and CI
|
|
19
|
+
|
|
20
|
+
> Requires **Node.js 18+**. Free links last 2 hours;
|
|
21
|
+
> [PortPrism Pro](https://portprism.io/#pricing) adds persistent links, password
|
|
22
|
+
> protection, custom subdomains, and analytics.
|
|
23
|
+
|
|
24
|
+
---
|
|
25
|
+
|
|
26
|
+
## Quick start
|
|
27
|
+
|
|
28
|
+
Start your app (any stack, any port), then in a second terminal:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npx portprism 3000
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
```
|
|
35
|
+
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
|
|
36
|
+
โ PortPrism ยท My App โ
|
|
37
|
+
โ Share URL https://viewer.portprism.io/v/ab3k โ
|
|
38
|
+
โ Local http://localhost:3000 โ
|
|
39
|
+
โ Expires 1h 59m โ
|
|
40
|
+
โ Status โ Connected โ
|
|
41
|
+
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Send the `viewer.portprism.io/v/โฆ` URL to anyone. Press `Ctrl+C` to stop.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# No install โ always the latest (recommended)
|
|
50
|
+
npx portprism <target>
|
|
51
|
+
|
|
52
|
+
# Or install globally
|
|
53
|
+
npm install -g portprism
|
|
54
|
+
portprism <target>
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Usage
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx portprism [options] <target>
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
`<target>` is a **port** (forwarded to `localhost`) or a **`host:port`** pair:
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx portprism 3000 # โ localhost:3000
|
|
67
|
+
npx portprism my-app.local:8080 # โ custom host
|
|
68
|
+
npx portprism 127.0.0.1:5000 # โ specific address
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Options
|
|
72
|
+
|
|
73
|
+
| Flag | Description |
|
|
74
|
+
| ----------------------- | ------------------------------------------------------------------- |
|
|
75
|
+
| `--name <label>` | App name shown in the viewer and CLI box |
|
|
76
|
+
| `--desc <text>` | One-line description shown in the viewer |
|
|
77
|
+
| `--password <pw>` | Require a password to view the link _(Pro)_ |
|
|
78
|
+
| `--qr` | Print the share URL as a scannable QR code |
|
|
79
|
+
| `--qr-invert` | Swap the QR's black/white cells for light terminals |
|
|
80
|
+
| `--json` | Emit machine-readable NDJSON events instead of the box (scripts/CI) |
|
|
81
|
+
| `--inspect` | Serve a local request inspector at `http://localhost:4040` |
|
|
82
|
+
| `--inspect-port <port>` | Port for the request inspector (default `4040`) |
|
|
83
|
+
| `--no-open` | Don't auto-open the viewer URL in your browser |
|
|
84
|
+
| `--no-screenshot` | Skip the automatic preview screenshot |
|
|
85
|
+
| `--relay <url>` | Override the relay WebSocket URL (self-hosting) |
|
|
86
|
+
| `--help` | Show all options |
|
|
87
|
+
|
|
88
|
+
### Account commands
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
portprism login # sign in with a magic-link / one-time code
|
|
92
|
+
portprism logout # remove saved credentials
|
|
93
|
+
portprism whoami # show the current account and plan
|
|
94
|
+
portprism upgrade # open the Pro checkout in your browser
|
|
95
|
+
portprism referral # show your referral link for bonus tunnel-time
|
|
96
|
+
portprism config # open ~/.portprism/config.json in $EDITOR
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Request inspector (`--inspect`)
|
|
100
|
+
|
|
101
|
+
Add `--inspect` to open a live, self-hosted traffic ledger at
|
|
102
|
+
**`http://localhost:4040`** โ every HTTP request forwarded through your tunnel is
|
|
103
|
+
listed chronologically with its headers, query parameters, and decoded
|
|
104
|
+
request/response bodies, updating live over Server-Sent Events. Ideal for debugging
|
|
105
|
+
webhooks and API callbacks. It runs on Node's built-in HTTP server (no extra install)
|
|
106
|
+
and keeps the last 200 requests in memory.
|
|
107
|
+
|
|
108
|
+
## AI agents (MCP)
|
|
109
|
+
|
|
110
|
+
PortPrism speaks the [Model Context Protocol](https://modelcontextprotocol.io):
|
|
111
|
+
|
|
112
|
+
- **Local:** the [`portprism-mcp`](https://www.npmjs.com/package/portprism-mcp) stdio
|
|
113
|
+
server lets an agent `start_tunnel` / `stop_tunnel` / `list_tunnels` /
|
|
114
|
+
`get_tunnel_status`.
|
|
115
|
+
- **Remote:** `https://mcp.portprism.io/mcp` lets web connectors manage your live
|
|
116
|
+
tunnels (Bearer-token auth).
|
|
117
|
+
|
|
118
|
+
## Privacy & your data
|
|
119
|
+
|
|
120
|
+
PortPrism is designed to move your app's traffic, not to read it.
|
|
121
|
+
|
|
122
|
+
- **Encrypted end-to-end.** All traffic between the viewer's browser, the PortPrism
|
|
123
|
+
relay, and your machine travels over TLS (HTTPS / WSS).
|
|
124
|
+
- **Transparent proxy.** The relay forwards bytes between the viewer and your local
|
|
125
|
+
app. It does **not** read, modify, or store the **content** of the requests and
|
|
126
|
+
responses passing through your tunnel โ your application data never lands in our
|
|
127
|
+
database.
|
|
128
|
+
- **What is stored** (for signed-in users): your email and auth token (for login),
|
|
129
|
+
session metadata (app name, token, expiry, view/request counts for Pro analytics),
|
|
130
|
+
and billing records via Stripe (we never see card numbers).
|
|
131
|
+
- **Anonymous use:** free tunnels need no account. A one-way hashed device
|
|
132
|
+
fingerprint is used only to enforce the free-plan time quota.
|
|
133
|
+
- **Links are public by default** โ anyone with the URL can view your app. For
|
|
134
|
+
sensitive tools use `--password` (Pro) so only people with the password can open it.
|
|
135
|
+
- **Consent:** on first run the CLI asks you to accept the Privacy Policy once (stored
|
|
136
|
+
in `~/.portprism/consent.json`). In `--json` mode it won't prompt โ it exits with an
|
|
137
|
+
`error` event instead.
|
|
138
|
+
|
|
139
|
+
Full policy: **<https://portprism.io/privacy-policy.html>**
|
|
140
|
+
|
|
141
|
+
---
|
|
142
|
+
|
|
143
|
+
Docs: **<https://portprism.io/install.html>** ยท FAQ:
|
|
144
|
+
**<https://portprism.io/docs/faq.html>** ยท License: **MIT**
|