tnl

module
v0.1.0-rc.28 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 24, 2026 License: MIT

README

tnl

A stable dev URL for your app.

tnl starts your app and gives it an HTTPS URL. Each Git worktree gets its own, so you can open changes side by side. Use tnl.dev, put the URLs on a domain you own, or run the tnl server yourself.

start developing

In a Next.js or Vite project with a dev script:

pnpm add -D @tnldotdev/tnl@next
pnpm exec tnl init

tnl init creates tnl.config.ts with the command that starts your app. If your existing framework config needs a change, it tells you what to add.

pnpm exec tnl dev

Sign in when prompted. Your app starts, and tnl prints its URL:

+--[ tnl dev ]-- ready ----------------------------------------+
|                                                              |
|  https://app-checkout-a1b2c3d4.busy-toast.tnl.dev            |
|     |                                                        |
|     v                                                        |
|  tnl                                                         |
|     |                                                        |
|     v                                                        |
|  http://127.0.0.1:5173                                       |
|                                                              |
|  route version             1                                 |
|  framework                 vite                              |
|  automatically allowed IP  192.0.2.10                        |
|                                                              |
+-- ctrl+c to stop --------------------------------------------+

Follow the quickstart for the configuration and Next.js and Vite setup. The integration follows the port your app actually opens, including when another worktree already uses the preferred port. Live reload works through the URL.

already running an app?

On macOS or Linux, Homebrew installs the native client. Publish an HTTP app already listening on port 3000 without any project configuration:

brew install tnldotdev/tap/tnl
tnl publish 3000

tnl.dev is free now. Accounts and teams created while it is free will keep a free plan if paid options arrive. We'll announce usage limits before they apply.

why tnl?

ngrok and Cloudflare Tunnel can also give apps stable URLs and custom domains. tnl combines worktree-aware URLs, Next.js and Vite integrations, and a server you can run yourself. Visitor HTTPS stays encrypted until it reaches tnl beside your app.

Use your own domain · Run your own server · Commands and visitor access · Contribute

telemetry and license

tnl sends usage telemetry by default, even with a self-hosted server. Disable it with TNL_NO_TELEMETRY=true. See what is sent. The client and server are MIT-licensed; see the dependency notices.

Directories

Path Synopsis
cmd
tnl command
Command tnl is the client entry point for tnl.
Command tnl is the client entry point for tnl.
tnlbench command
Command tnlbench measures the complete tnl route path.
Command tnlbench measures the complete tnl route path.
tnld command
Command tnld runs the tnl server daemon.
Command tnld runs the tnl server daemon.
internal
authorityapi
Package authorityapi serves the built-in authority HTTP API.
Package authorityapi serves the built-in authority HTTP API.
authorityclient
Package authorityclient calls the authority API.
Package authorityclient calls the authority API.
authorization
Package authorization authorizes control operations and builds stable request hashes.
Package authorization authorizes control operations and builds stable request hashes.
benchworkload
Package benchworkload contains the publisher and visitor workloads shared by local runtime tests and deployed benchmarks.
Package benchworkload contains the publisher and visitor workloads shared by local runtime tests and deployed benchmarks.
certificates
Package certificates uses ACME to issue route and relay transport certificates.
Package certificates uses ACME to issue route and relay transport certificates.
clientauth
Package clientauth handles CLI login and coordinates control-session refresh.
Package clientauth handles CLI login and coordinates control-session refresh.
clientstate
Package clientstate stores local client data and tunnel snapshots.
Package clientstate stores local client data and tunnel snapshots.
clioutput
Package clioutput renders stable human-readable CLI diagrams.
Package clioutput renders stable human-readable CLI diagrams.
config
Package config defines the versioned YAML and JSON configuration format.
Package config defines the versioned YAML and JSON configuration format.
controlapi
Package controlapi serves the control API and authorizes route operations.
Package controlapi serves the control API and authorizes route operations.
controlclient
Package controlclient calls the tnl control API.
Package controlclient calls the tnl control API.
controlstate
Package controlstate stores persistent control state in PostgreSQL and changes that state in transactions.
Package controlstate stores persistent control state in PostgreSQL and changes that state in transactions.
controltls
Package controltls configures automatic public TLS for the control API.
Package controltls configures automatic public TLS for the control API.
credentials
Package credentials creates and validates typed credentials.
Package credentials creates and validates typed credentials.
diagnostic
Package diagnostic defines stable, user-facing diagnostics for tnl failures.
Package diagnostic defines stable, user-facing diagnostics for tnl failures.
dnscontroller
Package dnscontroller applies persistent DNS changes requested by control.
Package dnscontroller applies persistent DNS changes requested by control.
filelock
Package filelock acquires user-owned, mode-0600 regular lock files on Unix.
Package filelock acquires user-owned, mode-0600 regular lock files on Unix.
httpjson
Package httpjson reads and writes size-limited JSON.
Package httpjson reads and writes size-limited JSON.
ingress
Package ingress routes TLS connections by exact SNI hostname without terminating their TLS.
Package ingress routes TLS connections by exact SNI hostname without terminating their TLS.
ingressapi
Package ingressapi serves control's private API for ingress processes.
Package ingressapi serves control's private API for ingress processes.
localproxy
Package localproxy forwards one public hostname to one local HTTP target.
Package localproxy forwards one public hostname to one local HTTP target.
muxsession
Package muxsession carries multiplexed byte streams over supported transports.
Package muxsession carries multiplexed byte streams over supported transports.
naming
Package naming defines public-hostname rules used by control and ingress.
Package naming defines public-hostname rules used by control and ingress.
observability
Package observability provides process and service metrics without depending on one metrics provider.
Package observability provides process and service metrics without depending on one metrics provider.
oidcauth
Package oidcauth implements OIDC authentication and CLI login flows.
Package oidcauth implements OIDC authentication and CLI login flows.
opaqueid
Package opaqueid creates and validates opaque 128-bit identifiers.
Package opaqueid creates and validates opaque 128-bit identifiers.
projectconfig
Package projectconfig finds, loads, and validates project configuration.
Package projectconfig finds, loads, and validates project configuration.
projectmeta
Package projectmeta validates and writes browser-safe project metadata.
Package projectmeta validates and writes browser-safe project metadata.
proxyproto
Package proxyproto implements tnl's strict PROXY protocol v2 boundary.
Package proxyproto implements tnl's strict PROXY protocol v2 boundary.
publisher
Package publisher publishes one local service through a public route.
Package publisher publishes one local service through a public route.
relayapi
Package relayapi serves control's private API for relay processes.
Package relayapi serves control's private API for relay processes.
routebackend
Package routebackend defines how ingress opens a visitor stream to a publisher.
Package routebackend defines how ingress opens a visitor stream to a publisher.
router
Package router reads a size-limited TLS ClientHello and preserves every byte so the connection can replay it.
Package router reads a size-limited TLS ClientHello and preserves every byte so the connection can replay it.
routeusage
Package routeusage defines route usage data that can be combined across reports.
Package routeusage defines route usage data that can be combined across reports.
routeusageworker
Package routeusageworker finishes and sends stored route usage reports.
Package routeusageworker finishes and sends stored route usage reports.
serviceapi
Package serviceapi provides HTTP helpers for the private service APIs.
Package serviceapi provides HTTP helpers for the private service APIs.
sourcelimiter
Package sourcelimiter limits new visitor connections by source IP address.
Package sourcelimiter limits new visitor connections by source IP address.
sqlite
Package sqlite manages client SQLite connections and migrations.
Package sqlite manages client SQLite connections and migrations.
storagekey
Package storagekey encrypts recoverable secrets stored by control.
Package storagekey encrypts recoverable secrets stored by control.
streamcopy
Package streamcopy copies bytes in both directions and preserves half-closes.
Package streamcopy copies bytes in both directions and preserves half-closes.
tlschallenge
Package tlschallenge manages publisher-local TLS challenge keys and certificates.
Package tlschallenge manages publisher-local TLS challenge keys and certificates.
tnldconfig
Package tnldconfig loads and validates tnld process configuration.
Package tnldconfig loads and validates tnld process configuration.
tunnel
Package tunnel runs tunnelv1 sessions over supported transports.
Package tunnel runs tunnelv1 sessions over supported transports.
pkg
api/authorityv1
Package authorityv1 provides primitives to interact with the openapi HTTP API.
Package authorityv1 provides primitives to interact with the openapi HTTP API.
api/controlv1
Package controlv1 provides primitives to interact with the openapi HTTP API.
Package controlv1 provides primitives to interact with the openapi HTTP API.
api/ingressv1
Package ingressv1 provides primitives to interact with the openapi HTTP API.
Package ingressv1 provides primitives to interact with the openapi HTTP API.
api/relayv1
Package relayv1 provides primitives to interact with the openapi HTTP API.
Package relayv1 provides primitives to interact with the openapi HTTP API.
api/routeusagev1
Package routeusagev1 provides primitives to interact with the openapi HTTP API.
Package routeusagev1 provides primitives to interact with the openapi HTTP API.
protocol/tunnelv1
Package tunnelv1 defines messages for publisher connections and visitor streams.
Package tunnelv1 defines messages for publisher connections and visitor streams.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL