Skip to main content

Connect to your local development server remotely.

Project description

plain.tunnel

Expose your local development server to the internet.

Overview

Plain Tunnel is a hosted tunneling service that gives your local development server a public URL. You can use it to test webhooks from third-party services, preview your site on a mobile device, or share your work with someone temporarily.

To create a tunnel, run:

plain tunnel https://app.localhost:8443

This connects your local server to a randomly generated subdomain like yourname-abc1234.plaintunnel.com. The tunnel stays open until you stop it with Ctrl+C.

To use a consistent subdomain, pass the --subdomain option:

plain tunnel https://app.localhost:8443 --subdomain myapp

Now your tunnel will always be available at https://myapp.plaintunnel.com.

Integrating with plain.dev

You can run the tunnel automatically alongside your development server by adding it to your pyproject.toml:

[tool.plain.dev.run]
tunnel = {cmd = "plain tunnel $PLAIN_DEV_URL --subdomain myapp --quiet"}

The $PLAIN_DEV_URL variable is automatically set to your local server URL. The --quiet flag reduces log output so it does not clutter your terminal.

To display the tunnel URL in the plain dev header, add DEV_TUNNEL_URL to your .env file:

DEV_TUNNEL_URL=https://myapp.plaintunnel.com

CLI options

The cli command accepts these options:

Option Description
destination URL of your local server (required)
--subdomain Custom subdomain to use
--debug Enable debug logging
--quiet Only log warnings and errors

Examples:

# With debug logging to troubleshoot connection issues
plain tunnel https://app.localhost:8443 --debug

# Run as a standalone tool without installing
uvx plain-tunnel https://app.localhost:8443

Environment variables

You can configure the tunnel using environment variables instead of CLI options:

Variable Description
PLAIN_TUNNEL_SUBDOMAIN Default subdomain to use
PLAIN_TUNNEL_HOST Tunnel host (defaults to plaintunnel.com)

FAQs

How does the tunnel work?

The tunnel establishes a WebSocket connection to the Plain Tunnel server. When a request arrives at your public URL, the server forwards it through the WebSocket to your local machine. The TunnelClient then makes the request to your local server and sends the response back.

What happens if the connection drops?

The tunnel automatically reconnects if the connection is lost. It will retry up to 5 times with a 2-second delay between attempts.

Can I use this without installing Plain?

Yes. You can run the tunnel as a standalone tool using uvx:

uvx plain-tunnel https://localhost:8000

Do I need to configure ALLOWED_HOSTS?

If you are using Plain with a custom subdomain, you may need to add it to your ALLOWED_HOSTS setting:

# app/settings.py
ALLOWED_HOSTS = [
    "localhost",
    "app.localhost",
    "myapp.plaintunnel.com",
]

Installation

Install from PyPI:

uv add plain.tunnel --dev

Then run the tunnel:

plain tunnel https://app.localhost:8443

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

plain_tunnel-0.12.2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

plain_tunnel-0.12.2-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file plain_tunnel-0.12.2.tar.gz.

File metadata

  • Download URL: plain_tunnel-0.12.2.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_tunnel-0.12.2.tar.gz
Algorithm Hash digest
SHA256 5920079e9f25d78214a71e3e78cfc7f87ca52a8b49046c28b268affdbd128d2d
MD5 e809de5db4162ca096354466ac93b90f
BLAKE2b-256 87f953f12a566b36e3eb8828d4e7a9a1d8596fc83b4f6a1c267b64ce2f49325c

See more details on using hashes here.

File details

Details for the file plain_tunnel-0.12.2-py3-none-any.whl.

File metadata

  • Download URL: plain_tunnel-0.12.2-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.9 {"installer":{"name":"uv","version":"0.10.9","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for plain_tunnel-0.12.2-py3-none-any.whl
Algorithm Hash digest
SHA256 502bf21c863f6d89567c44c7a1da1fa4a290d874bc8bb4f4e2e0b34380f52985
MD5 781778ecc84a53a25053dd05d3cda7f4
BLAKE2b-256 a3f2a5b51557e210e68a229b9ed076129cd91c0a2471344c48fe298e6fd9c9dd

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page