Skip to main content

Connect to your local development server remotely.

Project description

plain.tunnel

Connect to your local development server remotely.

Overview

The Plain Tunnel is a hosted service, like ngrok or Cloudflare Tunnel, 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.

This is especially useful for testing webhooks, doing mobile styling on a real device, or temporarily sharing your local development URL with someone.

Basic usage:

plain tunnel https://app.localhost:8443

This will create a tunnel from a randomly generated subdomain to your local server. You can also specify a custom subdomain:

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

Usage with plain.dev

The simplest way to use plain.tunnel is to integrate it with your plain.dev configuration.

Add it to your plain.dev configuration in pyproject.toml:

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

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:

PLAIN_DEV_TUNNEL_URL=https://myappname.plaintunnel.com

CLI Usage

The cli command accepts the following options:

  • destination: The URL of your local development server (required)
  • --subdomain: Custom subdomain to use (optional, auto-generated if not provided)
  • --debug: Enable debug logging
  • --quiet: Only log warnings and errors

Examples:

# Basic usage with auto-generated subdomain
plain tunnel https://app.localhost:8443

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

# With debug logging
plain tunnel https://app.localhost:8443 --debug

# One-off usage without installation
uvx plain-tunnel https://app.localhost:8443

Configuration

Environment Variables

The tunnel can be configured using environment variables:

  • PLAIN_TUNNEL_SUBDOMAIN: Default subdomain to use
  • PLAIN_TUNNEL_HOST: Tunnel host (defaults to plaintunnel.com)

ALLOWED_HOSTS

Depending on your setup, you may need to add your tunnel to the settings.ALLOWED_HOSTS. This can be done in settings.py or in your dev .env:

PLAIN_ALLOWED_HOSTS='["*"]'

Or more specifically:

# settings.py
ALLOWED_HOSTS = ["myappname.plaintunnel.com"]

Installation

Install the plain.tunnel package from PyPI:

uv add plain.tunnel --dev

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.6.0.tar.gz (26.2 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.6.0-py3-none-any.whl (10.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: plain_tunnel-0.6.0.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.8.18

File hashes

Hashes for plain_tunnel-0.6.0.tar.gz
Algorithm Hash digest
SHA256 e9e0ca5ab72dc920a3ea549bc7c62cbce0a2adfab8e2e953c0cf6f95c66355f6
MD5 273594969bfcf7dd304d54fc992a84ae
BLAKE2b-256 9b3a08a9d33a4f1acd55729d0403c09671feb72ca62fc08abb144d14ebc528e8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for plain_tunnel-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee75faa374a80cb0266ff353339ecb8b05bb78823e045484bc06b679557878f1
MD5 abb3c8760e03ca77cfda46aefd3157da
BLAKE2b-256 593d0aee230a835b4a8538153ecf42964f835e8c31e3c28e08978711f2f8246c

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