xpose-dev 1.0.0
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 +134 -0
- package/dist/index.js +1494 -0
- package/dist/index.js.map +1 -0
- package/package.json +54 -0
package/README.md
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
# xpose-dev
|
|
2
|
+
|
|
3
|
+
Expose local servers to the internet via Cloudflare. Zero config, instant public URLs.
|
|
4
|
+
|
|
5
|
+
An open-source alternative to ngrok built on Cloudflare Workers.
|
|
6
|
+
|
|
7
|
+
## Quick start
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npx xpose-dev 3000
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This gives you a public URL like `https://abc123xyz456.xpose.dev` that forwards traffic to `localhost:3000`.
|
|
14
|
+
|
|
15
|
+
## Install globally
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install -g xpose-dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Then run:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
xpose-dev 3000
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### Expose a single port
|
|
30
|
+
|
|
31
|
+
```sh
|
|
32
|
+
npx xpose-dev 3000
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Expose multiple ports
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
npx xpose-dev 3000 8787
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Custom subdomain
|
|
42
|
+
|
|
43
|
+
```sh
|
|
44
|
+
npx xpose-dev --subdomain my-app 3000
|
|
45
|
+
# -> https://my-app-x7k2m4.xpose.dev
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Turborepo auto-discovery
|
|
49
|
+
|
|
50
|
+
Automatically detect ports from your Turborepo dev tasks:
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
npx xpose-dev --from-turbo
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Filter to specific packages:
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
npx xpose-dev --from-turbo --turbo-filter=@myorg/web
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### Set a custom TTL
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
npx xpose-dev --ttl 7200 3000
|
|
66
|
+
# Tunnel expires after 2 hours instead of the default 4
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
### Resume a previous session
|
|
70
|
+
|
|
71
|
+
After quitting, you can resume the same tunnel URLs within 10 minutes:
|
|
72
|
+
|
|
73
|
+
```sh
|
|
74
|
+
npx xpose-dev -r
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
## Options
|
|
78
|
+
|
|
79
|
+
| Flag | Description | Default |
|
|
80
|
+
| ---------------- | -------------------------------- | ------------ |
|
|
81
|
+
| `-r`, `--resume` | Resume the previous session | `false` |
|
|
82
|
+
| `--from-turbo` | Auto-detect ports from Turborepo | `false` |
|
|
83
|
+
| `--turbo-task` | Turborepo task to inspect | `dev` |
|
|
84
|
+
| `--turbo-filter` | Turborepo filter | - |
|
|
85
|
+
| `--turbo-path` | Path to Turborepo root | `.` |
|
|
86
|
+
| `--ttl` | Tunnel TTL in seconds | `14400` (4h) |
|
|
87
|
+
| `--subdomain` | Custom subdomain prefix | random |
|
|
88
|
+
| `--domain` | Public tunnel domain | `xpose.dev` |
|
|
89
|
+
|
|
90
|
+
## Features
|
|
91
|
+
|
|
92
|
+
- Instant public URLs for any local port
|
|
93
|
+
- WebSocket support (HMR works through the tunnel)
|
|
94
|
+
- Turborepo integration for monorepo dev workflows
|
|
95
|
+
- Auto-reconnection with exponential backoff
|
|
96
|
+
- Session resume (`-r`) to keep the same URLs after restart
|
|
97
|
+
- Custom subdomains
|
|
98
|
+
- No sign-up required
|
|
99
|
+
|
|
100
|
+
## How it works
|
|
101
|
+
|
|
102
|
+
The CLI opens a WebSocket connection to a Cloudflare Worker. When someone visits your public URL, the Worker forwards the request through the tunnel to your local server and sends the response back.
|
|
103
|
+
|
|
104
|
+
WebSocket connections (used by HMR / hot reload) are also relayed through the tunnel so live reload works out of the box.
|
|
105
|
+
|
|
106
|
+
## Publishing setup (for maintainers)
|
|
107
|
+
|
|
108
|
+
### npm token
|
|
109
|
+
|
|
110
|
+
1. Go to [npmjs.com](https://www.npmjs.com) and sign in
|
|
111
|
+
2. Click your avatar > **Access Tokens** > **Generate New Token**
|
|
112
|
+
3. Select **Automation** token type (bypasses 2FA for CI)
|
|
113
|
+
4. Copy the token
|
|
114
|
+
|
|
115
|
+
### GitHub Actions secret
|
|
116
|
+
|
|
117
|
+
1. Go to your GitHub repo > **Settings** > **Secrets and variables** > **Actions**
|
|
118
|
+
2. Click **New repository secret**
|
|
119
|
+
3. Name: `NPM_TOKEN`
|
|
120
|
+
4. Value: paste the npm token from step above
|
|
121
|
+
5. Click **Add secret**
|
|
122
|
+
|
|
123
|
+
### Release process
|
|
124
|
+
|
|
125
|
+
1. Tag a release: `git tag v0.2.0 && git push origin v0.2.0`
|
|
126
|
+
2. The `cli-npm-release.yml` workflow will automatically:
|
|
127
|
+
- Run tests
|
|
128
|
+
- Build the package
|
|
129
|
+
- Set the version from the git tag
|
|
130
|
+
- Publish to npm
|
|
131
|
+
|
|
132
|
+
## License
|
|
133
|
+
|
|
134
|
+
MIT
|