Skip to Content
Xeonr Developer Docs

TCP tunnels

Postgres, Redis, SSH — and how to expose one without a public port at all.

burrow tcp 5432 --allow cidr:203.0.113.0/24
  Forwarding   tcp://tcp.brw.xnr.app:20431  ->  localhost:5432

A TCP tunnel gets a port from a shared pool, leased on the same 72-hour terms as a generated hostname — reconnect and you get the same port back, so the alias in your shell history keeps working. A reserved name can pin one permanently.

It is closed unless you say otherwise

A raw stream has nobody to ask for a login, so an HTTP tunnel's rules cannot apply to one. Burrow refuses to start a TCP tunnel that says nothing about who may reach it:

$ burrow tcp 5432
burrow: a TCP tunnel needs to say who may reach it: add --allow cidr:<range>,
        or --public to open it to anybody

--public exists, needs saying out loud, and is recorded in the activity feed.

The better option: no public port

burrow connect carries the traffic over an authenticated connection instead, so nothing is listening on the internet at any point:

# the owner, exposing it to nobody in particular
burrow tcp 5432 --name pgdev --allow team

# anybody on the team, on their own machine
burrow connect pgdev --local 15432
psql -h 127.0.0.1 -p 15432

The consumer authenticates as themselves, and the tunnel's full rule set — team, user:, group: — is applied to them before the streams are joined. This is the recommended way to share a database, and a UDP tunnel has the same option with --udp.

--local takes an address, or a bare port on 127.0.0.1.

What is recorded

Connections are logged, whether they arrived on the pool port or through burrow connect: when they opened and closed, the peer address, bytes each way, and the outcome. A connection through burrow connect also records who signed in. Payload is never captured — a TCP stream is not ours to read.

On this page