Skip to content

Commit 0fc1a49

Browse files
committed
Plain tunnel docs
1 parent 8000c67 commit 0fc1a49

File tree

1 file changed

+40
-1
lines changed

1 file changed

+40
-1
lines changed

plain-tunnel/plain/tunnel/README.md

+40-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,40 @@
1-
## plain.tunnel
1+
# plain.tunnel
2+
3+
**Connect to your local development server remotely.**
4+
5+
The Plain Tunnel is a hosted service, like [ngrok](https://ngrok.com/) or [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/), that is specifically designed to work with Plain and provide the minimum set of features you need to get your local development server connected to the internet. It will provision a subdomain of plaintunnel.com for you, and forward traffic to your local development server.
6+
7+
This is especially useful for testing webhooks, doing mobile styling on a real device, or temporarily sharing your local development URL with someone.
8+
9+
_Note: In the future this will likely require a small subscription to use custom subdomains (vs randomly generated ones)._
10+
11+
## Usage
12+
13+
The simplest way to use `plain.tunnel` is to install it from PyPI (`uv add plain.tunnel --dev`), then add it to your `plain.dev` configuration.
14+
15+
```toml
16+
[tool.plain.dev.run]
17+
tunnel = {cmd = "plain tunnel $PLAIN_DEV_URL --subdomain myappname --quiet"}
18+
```
19+
20+
To show a tunnel URL (whether you are using `plain.tunnel` or not), you can add `PLAIN_DEV_TUNNEL_URL` to your local `.env` file.
21+
22+
```env
23+
PLAIN_DEV_TUNNEL_URL=https://myappname.plaintunnel.com
24+
```
25+
26+
![](https://assets.plainframework.com/docs/plain-dev-tunnel.png)
27+
28+
Depending on your setup, you may need to add your tunnel to the `settings.ALLOWED_HOSTS`, which can be done in `settings.py` or in your dev `.env`.
29+
30+
```env
31+
PLAIN_ALLOWED_HOSTS='["*"]'
32+
```
33+
34+
## CLI
35+
36+
To use `plain.tunnel` manually, you can use the `plain tunnel` command (or even use it as a one-off with something like `uvx plain-tunnel`).
37+
38+
```console
39+
plain tunnel https://app.localhost:8443
40+
```

0 commit comments

Comments
 (0)