reoclo tunnel
reoclo tunnel <server> [-L <spec>]... [-R <spec>]... [--udp] [--bind-public] [--reconnect-deadline <seconds>]reoclo tunnel ls [--server <server>] [--active]reoclo tunnel describe <tunnel-id>reoclo tunnel close <tunnel-id>
reoclo tunnel setup [--domain <suffix>]... [--port-443] [--no-service] [--no-trust] [--no-hosts]reoclo tunnel status [name]reoclo tunnel add <name> --server <server> --target <host:port|port> [--kind tcp|udp] [--local-port <port>] [--hostname <name>] [--via reoclo|tailscale|auto] [--tailnet-host <name>] [--keep-up] [--no-up]reoclo tunnel add <name> --server <server> --kind https --target <host:port|port> [--hostname <name>] [--via reoclo|tailscale|auto] [--tailnet-host <name>] [--keep-up] [--no-up]reoclo tunnel add <name> --server <server> --kind reverse --remote-port <port> --local-target <host:port|port> [--bind-public] [--no-up]reoclo tunnel add <name> --kind local --hostname <name> --local-target <host:port|port> [--no-up]reoclo tunnel edit <name> [options]reoclo tunnel rm <name>...reoclo tunnel up <name>...reoclo tunnel down <name>...reoclo tunnel share <name> --tailnet [--port <port>]reoclo tunnel unshare <name>reoclo tunnel approvals [--all]reoclo tunnel approve <id>reoclo tunnel deny <id>reoclo tunnel daemon run|start|stop|status|logs|install|uninstall
reoclo tunnel trust [--domain <suffix>]...reoclo tunnel untrustreoclo tunnel ca-pathreoclo tunnel opens a TCP or UDP tunnel between your machine and a server, through the server’s runner. The tunnel rides the runner’s existing outbound connection, so you don’t need SSH keys or an inbound firewall rule. The server must be connected with a runner. SSH-only servers don’t support one-shot tunnels, but a saved tunnel that uses Tailscale works with them.
Pass the server by name, slug, or id. The command stays in the foreground and closes the tunnel when you press Ctrl-C. To keep a tunnel up without a terminal, save it instead.
Forward tunnels (-L)
Section titled “Forward tunnels (-L)”A forward tunnel listens on your machine and sends the traffic to a host and port reachable from the server.
-L [bind:]local_port:remote_host:remote_port-L local_port:remote_portWith only two parts, the remote host is 127.0.0.1 on the server. The local side binds 127.0.0.1 unless you give 127.0.0.1 or 0.0.0.0 as the first part. Use local port 0 to let the CLI pick a free port. The command prints the port it bound.
$ reoclo tunnel reoclo-production -L 5432:5432tunnel: connected-L 127.0.0.1:5432 → reoclo-production:127.0.0.1:5432 (tcp)Ctrl-C to closeCommon forms:
# Local port 15432 to Postgres on the serverreoclo tunnel reoclo-production -L 15432:5432
# Reach a host that only the server can seereoclo tunnel reoclo-production -L 5432:db.internal:5432
# Two forwards in one sessionreoclo tunnel reoclo-production -L 5432:5432 -L 6379:6379Reverse tunnels (-R)
Section titled “Reverse tunnels (-R)”A reverse tunnel listens on the server and sends the traffic to a host and port on your side. Use it to show a service running on your laptop to something on the server.
-R [bind:]remote_port:local_host:local_port-R remote_port:local_portWith two parts, the local host is 127.0.0.1. The server side binds 127.0.0.1 by default, so only processes on the server can reach it. To bind 0.0.0.0 on the server, pass --bind-public and put 0.0.0.0 first in the spec. Your organization’s tunnel policy can forbid reverse tunnels or public binds, and the command then fails with a message saying so.
# Server port 8080 reaches localhost:3000 on your machinereoclo tunnel reoclo-production -R 8080:3000You can mix -L and -R in one session.
TCP and UDP
Section titled “TCP and UDP”Tunnels carry TCP by default. Add --udp to carry UDP instead. The flag applies to every -L and -R in that command, so open a second session if you need both protocols. Your organization’s tunnel policy can disable UDP.
reoclo tunnel reoclo-production -L 5353:53 --udpOptions
Section titled “Options”| Option | Meaning |
|---|---|
-L <spec> | Forward tunnel. Repeat for more than one |
-R <spec> | Reverse tunnel. Repeat for more than one |
--udp | Use UDP for all specs in this command |
--bind-public | Let -R bind 0.0.0.0 on the server |
--reconnect-deadline <seconds> | How long to keep trying to reconnect before giving up. Default 300 |
At least one -L or -R is required.
Concurrent tunnel limit
Section titled “Concurrent tunnel limit”Each person and each organization can have a limited number of tunnels open at once. The defaults are 4 per user and 32 per organization, and your organization’s tunnel policy can change them. When you reach the limit, the new tunnel exits straight away instead of retrying, with a message like this:
tunnel: max concurrent tunnels per user reached (4); see reoclo tunnel ls. Run `reoclo tunnel ls` to see open tunnels and `reoclo tunnel close <id>` to free one.The organization limit reads max concurrent tunnels per tenant reached (32). Run reoclo tunnel ls --active to see what is open, then close one you no longer need. A tunnel that is waiting out a runner reconnect still holds its slot.
Needs CLI 0.94.1 or newer. Older versions treat the refusal as a dropped connection and keep retrying.
Reconnects and runner blips
Section titled “Reconnects and runner blips”Tunnels are built to survive short interruptions.
- Your connection drops. The CLI reconnects with a growing delay between attempts and prints
tunnel: reconnecting. Your local listeners stay open. If it can’t reconnect within--reconnect-deadline(300 seconds by default), it exits with an error. A Reoclo restart is handled the same way. - The runner reconnects. If the server’s runner drops and comes back, Reoclo keeps your tunnel open and waits for it. Connections that were in flight at that moment are reset, and new connections are refused until the runner is back. When it returns, the tunnel resumes without a restart. A reverse tunnel listens on the server again on its own.
- The runner stays away. After about 90 seconds without the runner, the tunnel closes and the CLI exits with
runner_disconnected. Start the command again once the server is back. - Maximum duration. Tunnels close after the maximum duration in your organization’s policy, 8 hours by default.
The CLI doesn’t retry when the failure can’t fix itself: an expired or revoked sign-in, a missing permission, a server that doesn’t exist, a runner that isn’t connected, or the concurrent tunnel limit. It prints the reason and exits with code 1.
Large transfers
Section titled “Large transfers”Uploads and downloads of any size work, including a large request body sent through a tunnel in one go. The CLI sends data in small pieces, and Reoclo splits anything bigger before it reaches the server. Needs CLI 0.94.1 or newer to send in small pieces. Older versions still work, because Reoclo splits their writes up to 8 MiB. A single write larger than that fails that one connection, and the rest of the tunnel keeps running.
Lists tunnel sessions in your organization, open and closed, newest first.
$ reoclo tunnel ls --server reoclo-production --activeTUNNEL ID SERVER MODE PROTO PORTS OPENED STATUS BYTES IN/OUT8c1e5b4a-2f3d-4b8e-9a70-6d1f0c2e7a15 prod-1 forward tcp :5432→127.0.0.1:5432 2026-11-02T09:14:07Z active 1.2MB/48.0KB| Option | Meaning |
|---|---|
--server <server> | Only sessions on this server |
--active | Only sessions that are still open |
describe <tunnel-id>
Section titled “describe <tunnel-id>”Prints every field of one session, including bytes and datagrams in each direction and a list of any runner interruptions with whether each one recovered. When Reoclo returns the session’s targets, describe also lists each distinct destination the session carried traffic to, with its mode, protocol, host, port and the time it first appeared. A session that a saved tunnel pool shares lists every target it served.
close <tunnel-id>
Section titled “close <tunnel-id>”Asks Reoclo to close a live tunnel. The CLI running that tunnel sees the connection end. Pass the ID shown in the TUNNEL ID column of ls.
$ reoclo tunnel close 8c1e5b4a-2f3d-4b8e-9a70-6d1f0c2e7a15tunnel: close requested for 8c1e5b4a-2f3d-4b8e-9a70-6d1f0c2e7a15Sometimes a session shows as open in ls although nothing holds it any more, for example after a crash. close cleans that up. When no live connection exists, the command reports it and marks the session closed:
tunnel: 8c1e5b4a-2f3d-4b8e-9a70-6d1f0c2e7a15 had no live connection; marked it closedIf the session was seen live within the last couple of minutes, Reoclo leaves it open, because another part of the platform may still hold it, and the command says so:
tunnel: 8c1e5b4a-2f3d-4b8e-9a70-6d1f0c2e7a15 was seen on a gateway in the last few minutes, so it was left open; try again shortlyWait a minute and run close again. A session that is already closed exits with tunnel: <id> is already closed. Open sessions that no live connection holds are also closed on their own after a few minutes.
Set up this machine
Section titled “Set up this machine”reoclo tunnel setupRuns the one-time steps that prepare a machine for tunnels, in order:
| Step | What it does | Same as |
|---|---|---|
| Start at login | Starts the tunnel daemon at login | reoclo tunnel daemon install |
| Local CA | Creates the local CA and trusts it, so browsers accept HTTPS tunnels | reoclo tunnel trust |
| Hosts helper | Installs the root helper that manages hostnames in /etc/hosts | reoclo hosts setup |
Run it as often as you like. A step that is already done is left alone, and a step that fails does not stop the others. The command exits 1 if any step failed.
Trusting the CA can raise a system prompt and the hosts helper asks for sudo, so run this in a terminal. Without one, those two steps are skipped.
It finishes by reporting your sign-in, whether HTTPS URLs need a port, and whether Tailscale is available. It does not change any of those.
| Flag | Effect |
|---|---|
--domain <suffix> | Also allow this suffix for certificates and hostnames, such as internal. Repeatable |
--port-443 | Relay port 443 to the HTTPS port so URLs drop the port. Refused while another program answers on 443 |
--no-service | Do not start the daemon at login |
--no-trust | Do not trust the local CA |
--no-hosts | Do not install the hosts helper |
Saved tunnels
Section titled “Saved tunnels”A saved tunnel is a named tunnel that a background process, the tunnel daemon, keeps for you. It survives closing the terminal and comes back after the daemon restarts, so you set it up once and use it like a local service.
# Save it and bring it up. Postgres on prod-1 is now on 127.0.0.1:5432.reoclo tunnel add prod-db --server prod-1 --target 5432
# See every saved tunnelreoclo tunnel statusThe first command that needs the daemon starts it. You never have to start it by hand, but you can: see the daemon.
| Kind | Meaning |
|---|---|
tcp | Forward TCP. The default |
udp | Forward UDP |
https | Forward a web service to a trusted HTTPS hostname on your machine. See HTTPS tunnels |
reverse | The server listens and sends traffic to a host and port on your machine |
local | Serve a hostname over HTTPS and forward it to a TCP address on this machine. See Local routes |
Where the tunnel listens
Section titled “Where the tunnel listens”A tcp or udp tunnel listens on 127.0.0.1 at its local port. An https tunnel binds no port of its own: the daemon’s HTTPS listener serves it by hostname.
A forward tunnel listens on 127.0.0.1 at its local port. Pass --local-port to choose the port. Without it, add uses the target port when it is free and a free port otherwise, then saves the port, so it never changes afterwards. Local ports must be unique across your forward tunnels.
Organization and sign-in
Section titled “Organization and sign-in”add saves the organization like every other command: from --org, $REOCLO_ORG or a .reoclo file. It also saves the profile you were using. The daemon signs in with that saved profile each time it opens a session, so you do not pass a token. When the stored sign-in can no longer be refreshed, the tunnel moves to needs_sign_in. Run reoclo login and the next connection works.
status [name]
Section titled “status [name]”Prints a table of saved tunnels: name, server, kind, local address, target, state, path, shared and detail. The local column shows the URL for an https tunnel. The path is relay or tailscale, and the shared column shows where a share answers once it is up. Pass a name to show one tunnel. With -o json it prints one object per line, including the message, the suggested action, traffic counters and, for an https tunnel, its hostname and url. Every tunnel carries via and path, plus path_reason, peer and share when there is something to report. A tunnel an agent opened shows (ad-hoc) after its kind, and its detail says when it ends.
For an ad-hoc tunnel the JSON also carries adhoc: true and expires_at.
A tunnel started in a terminal with reoclo tunnel <server> -L ... is listed after the saved tunnels, under Running in a terminal, with its forwards and process ID. It appears in the text output only; -o json lists saved tunnels. The Reoclo desktop app shows the same list and can stop a tunnel. A tunnel started by an older CLI appears after you restart it.
$ reoclo tunnel statusNAME SERVER KIND LOCAL TARGET STATE PATH SHARED DETAILprod-db prod-1 tcp 127.0.0.1:15432 prod-1:127.0.0.1:5432 ready relayadd <name>
Section titled “add <name>”| Option | Meaning |
|---|---|
--server <server> | Server name, slug or id. Required for every kind except local |
--target <host:port|port> | Forward: where the server connects. A bare port means 127.0.0.1 on the server |
--kind <kind> | tcp (default), udp, https, reverse or local. https is the default when you pass --hostname and no kind |
--hostname <name> | The local hostname. An https tunnel defaults to <name>.<server>.reoclo.localhost. On a tcp or udp tunnel it only adds a hosts entry. A local route requires it |
--local-port <port> | tcp and udp: the local port to listen on |
--keep-up | Hold the session open instead of opening it on demand |
--no-up | Save the tunnel without bringing it up |
--remote-port <port> | Reverse: the port the server listens on |
--local-target <host:port|port> | Reverse and local: where this machine connects. A bare port means 127.0.0.1 |
--bind-public | Reverse: bind 0.0.0.0 on the server |
--via <transport> | reoclo (the relay, default), tailscale or auto. A tunnel to an SSH server defaults to tailscale. See Tailscale transport |
--tailnet-host <name> | The server’s name on your tailnet, when it differs from its Reoclo hostname |
Names use lowercase letters, digits and hyphens, start with a letter or digit, and hold up to 63 characters. A tunnel is up as soon as you add it unless you pass --no-up.
Adding an https tunnel prints a hint when the local CA is not trusted yet or the hosts helper is not installed.
# Reach a database that only the server can see, on a fixed local portreoclo tunnel add prod-db --server prod-1 --target db.internal:5432 --local-port 15432
# Open Grafana at https://grafana.prod-1.reoclo.localhost:8443reoclo tunnel add grafana --server prod-1 --kind https --target 3000
# Show a service on your laptop to the serverreoclo tunnel add hook --server prod-1 --kind reverse --remote-port 8080 --local-target 3000edit <name>
Section titled “edit <name>”Changes a saved tunnel. Pass any of --server, --target, --hostname, --local-port (tcp and udp only), --keep-up or --no-keep-up for a forward tunnel, and --server, --remote-port, --local-target, --bind-public or --no-bind-public for a reverse tunnel. Pass --hostname or --local-target to change a local route. Pass --via or --tailnet-host to change a forward or https tunnel’s transport. A tunnel that is up restarts with the new settings. You cannot rename a tunnel or change its kind; remove it and add it again.
rm <name>...
Section titled “rm <name>...”Brings the tunnels down and removes them. remove and delete also work in place of rm.
up <name>... and down <name>...
Section titled “up <name>... and down <name>...”up brings a saved tunnel up and down brings it down. The daemon remembers which tunnels are up and brings them back after a restart or a reboot, so down is how you stop one for good. A tunnel stays saved while it is down.
Sessions and pooling
Section titled “Sessions and pooling”All saved tunnels to one server share one session, so they use one slot of your concurrent tunnel limit. Six tunnels on two servers hold two slots. A tunnel that uses Tailscale opens no session and holds no slot.
- On demand. The session opens when the first local connection arrives for any of the server’s tunnels. The listeners stay up while it is closed, so the first connection after a quiet period waits for one handshake.
- Idle close. The session closes after 600 seconds with no open connection. The tunnels go back to
readyand the next connection reopens it. To change the period, setidle_timeout_secondsintunnels.yamlin the state directory and restart the daemon. - Keep up. A tunnel saved with
--keep-upopens its session when you bring it up and holds it, and reconnects with a growing delay of up to 30 seconds when the runner goes offline. A reverse tunnel always holds its session, because its connections arrive on the server, where the daemon cannot see them. - Maximum duration. When Reoclo closes a session at your organization’s maximum duration, the server’s tunnels move to
expiredand stay there. The daemon never reopens it on its own. Runreoclo tunnel up <name>on any tunnel of that server to start again. - Closed by an operator. A session closed with
reoclo tunnel closeor from the dashboard moves the tunnels toclosed_by_operator. They stay down until you runup.
Any up on a tunnel of a server clears expired and closed_by_operator for all of that server’s tunnels.
States
Section titled “States”| State | Meaning | What to do |
|---|---|---|
down | The tunnel is not up | Run reoclo tunnel up <name> |
ready | Listening, no session open | Nothing |
connecting | Opening the session | Nothing |
active | The session is open | Nothing |
reconnecting | The connection dropped and the session is retrying | Nothing |
needs_sign_in | The stored sign-in expired | Run reoclo login |
server_offline | The server’s runner is not connected | Try again later |
quota_reached | You reached the concurrent tunnel limit | Close another tunnel |
expired | The session reached the maximum duration | Run reoclo tunnel up <name> |
closed_by_operator | Someone closed the session | Run reoclo tunnel up <name> |
forbidden | The server or your policy refused the tunnel | Ask an organization admin |
failed | Anything else, such as a local port already in use | Read the detail column |
HTTPS tunnels
Section titled “HTTPS tunnels”An https tunnel serves a web service on the server at a hostname on your machine, with a certificate your browser trusts. The daemon terminates TLS and passes the bytes through, so WebSockets, server-sent events and keep-alive work unchanged. It does not parse HTTP, rewrite the Host header or add authentication. Your service sees the hostname you opened, so a service that checks Host (Vite, Django’s ALLOWED_HOSTS) needs that hostname allowed.
reoclo tunnel trustreoclo tunnel add grafana --server prod-1 --kind https --target 3000$ reoclo tunnel status grafanaNAME SERVER KIND LOCAL TARGET STATE PATH SHARED DETAILgrafana prod-1 https https://grafana.prod-1.reoclo.localhost:8443 prod-1:127.0.0.1:3000 ready relayThe URL carries :8443
Section titled “The URL carries :8443”The default URL carries :8443. An ordinary user cannot bind port 443 on macOS or Linux, so the daemon listens on port 8443 on 127.0.0.1 and ::1. To use another port, set https_port in tunnels.yaml and restart the daemon. If the port is already in use, every https tunnel shows failed with the reason. The daemon binds the port only while an https tunnel is up.
To drop the port from the URL, run reoclo hosts setup --port-443. See reoclo hosts for what it does and why it refuses to start while another program answers on port 443.
Hostnames
Section titled “Hostnames”The default hostname is <tunnel>.<server>.reoclo.localhost, with the server name lowercased and cut down to letters, digits and hyphens. .localhost names are reserved for your own machine, so they never collide with a real domain. Some programs, curl among them, resolve them to loopback on their own. Programs that use the system resolver, such as Safari and most other macOS apps, need a hosts entry: run reoclo hosts setup once.
A hostname must be a lowercase DNS name, unique across your saved tunnels and manual hosts, and end in reoclo.localhost or in a suffix you allowed with reoclo tunnel trust --domain. The daemon refuses an unknown hostname during the TLS handshake. A tunnel that is down answers no handshake either.
Certificates
Section titled “Certificates”The daemon signs a certificate for each hostname the first time something connects, with the local CA. Certificates last 30 days, live in memory only and renew after two thirds of that. The listener offers http/1.1 only.
Pooling
Section titled “Pooling”An https tunnel shares its server’s session with every other saved tunnel to that server, like a tcp tunnel does. See Sessions and pooling.
Local routes
Section titled “Local routes”A local route serves a hostname over HTTPS through the daemon’s listener and forwards the decrypted traffic to a TCP address on this machine. It has no server, organization or sign-in, so you can add one without credentials. Use it to put a service that runs on your own machine behind a trusted HTTPS hostname.
reoclo tunnel add dev-app --kind local --hostname app.reoclo.test --local-target 127.0.0.1:48080A local route uses the same hostnames, certificates and local CA as an https tunnel, so its hostname must end in reoclo.localhost or in a suffix you allowed with reoclo tunnel trust --domain, and it must be unique across your saved tunnels. If nothing accepts connections at the local target, the daemon closes that connection and logs one line. --server, --target and --via do not apply to a local route.
Trust the local CA
Section titled “Trust the local CA”reoclo tunnel trust creates a certificate authority for this machine and adds it to your system trust store. Browsers then accept the certificates the daemon signs.
| Command | What it does |
|---|---|
reoclo tunnel trust [--domain <suffix>]... | Create the CA and trust it. Repeat --domain to allow more suffixes |
reoclo tunnel untrust | Remove the CA from every store it was added to and delete its key |
reoclo tunnel ca-path | Print the path of the CA certificate. Exits 1 when there is no CA |
- macOS.
trustadds the CA to your login keychain as a trusted root. macOS shows its own authentication prompt. - Linux.
trustcopies the CA to/usr/local/share/ca-certificates, runsupdate-ca-certificateswithsudo, and also adds it to~/.pki/nssdbfor Chromium when that directory andcertutilexist. - Firefox keeps its own store. Set
security.enterprise_roots.enabledtotrueinabout:config, or import the file thatca-pathprints. - Node and Bun do not read the system store. Point
NODE_EXTRA_CA_CERTSat the fileca-pathprints. For curl, pass it to--cacert.
The CA uses ECDSA P-256, lasts two years, and carries a critical name constraint that limits it to reoclo.localhost and the suffixes you allow. If its key ever leaks, it cannot sign a certificate for any other domain. The key is stored in ca/ca.key with mode 0600.
A suffix like internal lets you use hostnames such as grafana.internal:
reoclo tunnel trust --domain internalA single-label suffix must be a reserved name (internal, test, local, localhost, lan, home, invalid, example or localdomain). Any multi-label suffix works, such as corp.example.com. Changing the suffixes issues a new CA, removes the old one from the trust store, and asks you to trust the new one. trust saves the suffixes in ca_suffixes in tunnels.yaml. Writing a custom hostname to your hosts file also needs the suffix on the helper’s allowlist: see reoclo hosts setup.
Tailscale transport
Section titled “Tailscale transport”A saved tunnel can reach the server over your tailnet instead of through the Reoclo relay. The daemon dials the server’s tailnet address directly and pipes the bytes, so the traffic never touches the Reoclo gateway. See Tunnels over Tailscale for a walkthrough.
reoclo tunnel add prod-db --server prod-1 --target 5432 --via tailscalevia | Meaning |
|---|---|
reoclo | Always use the relay. The default |
tailscale | Always use the tailnet. A connection the tailnet cannot carry is refused, and the tunnel shows failed with the reason |
auto | Choose for each connection: the tailnet when it can carry it, the relay otherwise |
--via works on tcp, udp and https tunnels. A reverse tunnel opens a listener on the server, which only the relay can do, so it always uses the relay. --keep-up holds a gateway session, so it does not go with --via tailscale.
- Finding the server.
addsaves the server’s hostname with the tunnel. The daemon looks for a peer intailscale status --jsonwith that name: the peer’sHostNamefirst, then the first label of its DNS name, ignoring case. If the server has another name on your tailnet, pass--tailnet-host. - Where it dials. The daemon connects to the peer’s first IPv4 tailnet address. A target on the server’s loopback (
127.0.0.1orlocalhost) is rewritten to that address. A target with any other host, such asdb.internal, is not eligible, because only the server can resolve that name. - Which ports work. The service must listen on
0.0.0.0,::or the tailnet address. The server’s stored port scan shows each port’s bind address. A port that listens only on127.0.0.1or::1cannot be reached, so avia: tailscaletunnel refuses its connections andaddprints a warning before it saves. A port missing from the scan is allowed, because the scan may be out of date. autoand fallback.autouses the tailnet when Tailscale is running, the peer is online, the target is eligible and the port is reachable. It uses the relay otherwise, andstatussays why in the detail column. If a dial over the tailnet fails, that one connection falls back to the relay.- UDP. The daemon keeps one tailnet socket for each local peer and closes it after 60 seconds without datagrams, the same rule the relay applies.
- Policy and audit. Traffic over the tailnet is your own network path, so it does not count against your organization’s concurrent tunnel limits, maximum duration or bandwidth limit, and it does not appear in the platform audit. The daemon records each connection in its log.
- SSH servers. An SSH server has no runner, so its tunnels can only use the tailnet.
adddefaults them to--via tailscale.
Share a tunnel on your tailnet
Section titled “Share a tunnel on your tailnet”A tcp or https tunnel can also be shared with the other devices on your tailnet. The daemon runs tailscale serve for the tunnel, and a device that your tailnet’s access rules allow to reach this machine opens the share the way it would open any service on it. The traffic still leaves through your Reoclo session. Sharing never publishes anything to the internet.
reoclo tunnel share grafana --tailnetreoclo tunnel unshare grafana| Option | Meaning |
|---|---|
--tailnet | Share on the tailnet. Required, because a tailnet is the only place a tunnel can be shared |
--port <port> | The port other devices connect to. The default is 443 for an https tunnel and the target’s port for a tcp tunnel |
httpstunnels appear athttps://<machine>.<tailnet>.ts.net:<port>with Tailscale’s own certificate. The tailnet needs HTTPS certificates turned on. The daemon forwardstailscale serve --https=<port>to a plaintext listener on127.0.0.1that it keeps for the tunnel on a port saved intunnels.yamlasinternal_port, so the port never changes.tcptunnels are published withtailscale serve --tcp=<port>, forwarding to the tunnel’s local port.- A share lives as long as its tunnel. Each share is a foreground
tailscale serveprocess of the daemon, never a background one. It stops when the tunnel goes down, when you remove it, and when the daemon stops. The daemon records the process ids inrun/shares.json, and a daemon that starts after a crash stops any it finds there. - A share that dies restarts. The daemon restarts it with a delay that grows to 30 seconds, and the detail column shows why it is not up. A share that cannot start says so plainly: Tailscale is missing or not running, HTTPS certificates are off for the tailnet, or the port is already served.
- Sharing restarts the tunnel, so connections that are open end.
- The
SHAREDcolumn ofreoclo tunnel statusshows the share’s address once it is up, and its state before that.
An agent needs your approval to share or unshare a tunnel. See Approvals.
Agent access
Section titled “Agent access”An agent that runs reoclo mcp can list, open, close and save tunnels through the daemon. Every request it sends carries the agent’s name, so the daemon can tell an agent from you.
Ad-hoc tunnels
Section titled “Ad-hoc tunnels”An agent can open a forward tunnel to a service on a server without saving anything. An ad-hoc tunnel:
- listens on a free port on
127.0.0.1and has no hostname, so it never changes your hosts file; - never appears in
tunnels.yaml, and a daemon restart ends it; - ends after its time to live, 60 minutes by default and at most 480, or earlier when the agent closes it or you run
reoclo tunnel down <name>; - shares one session per server with your saved tunnels, so they all hold one slot of the concurrent tunnel limit.
The daemon opens the session before it answers, and waits up to 30 seconds. A sign-in that expired, a tunnel the server refuses or an offline runner reaches the agent as an error instead of failing on its first connection, and the daemon drops the tunnel. You cannot edit an ad-hoc tunnel.
Approvals
Section titled “Approvals”By default an agent cannot do these without you:
- save, edit or bring up a reverse tunnel, or a tunnel bound on all interfaces (
--bind-public); - add, change or remove a hostname, which includes saving any
httpstunnel; - trust or untrust the local CA;
- share a tunnel on the tailnet, or stop sharing it.
An agent never needs approval to close a tunnel, to open an ad-hoc tunnel, or to save or bring up a plain tcp or udp tunnel without a hostname.
When an agent asks for one of these, the daemon keeps the request: the agent’s name, the action and a description. The agent waits up to 60 seconds. If nobody answers, it gets pending_approval with an id and tells you what it is waiting for. The request stays for 10 minutes and then expires. The daemon holds requests in memory, so a restart drops them.
$ reoclo tunnel approvalsID AGENT ACTION REQUEST EXPIRESa1b2c3d4 claude-code save_tunnel Save reverse tunnel "hook": prod-1 port 8080 to 127.0.0.1:3000 on this machine in 9m
$ reoclo tunnel approve a1b2c3d4tunnel: approved a1b2c3d4: Save reverse tunnel "hook": prod-1 port 8080 to 127.0.0.1:3000 on this machine| Command | What it does |
|---|---|
reoclo tunnel approvals [--all] | List the requests waiting for you. --all adds the ones decided in the last hour, with their status |
reoclo tunnel approve <id> | Run the request. If the action then fails, the command prints the reason and exits 1 |
reoclo tunnel deny <id> | Drop the request |
These commands need a running daemon and do not start one. An agent cannot approve, deny or change the daemon’s settings: the daemon refuses those requests when they come from MCP.
To turn approvals off, set agent_approvals: off at the top of tunnels.yaml and restart the daemon. Agents can then do everything the CLI can.
Approvals are a guardrail, not a sandbox. An agent runs as your user, so it could run reoclo tunnel add --kind reverse in a shell or talk to the daemon’s socket itself. Approvals stop a well-meaning agent from doing more than you asked. They do not contain a hostile process.
The daemon
Section titled “The daemon”The tunnel daemon is the reoclo binary running in the background, one per user. It holds the saved tunnels, the local listeners and the gateway sessions. Commands talk to it over a Unix socket that only your user can open.
| Command | What it does |
|---|---|
reoclo tunnel daemon start | Start it in the background and wait until it answers |
reoclo tunnel daemon stop | Stop it. Tunnels that are up come back on the next start |
reoclo tunnel daemon status | Show the version, process id, uptime, tunnel counts, the HTTPS listener, the local CA, the hosts helper and Tailscale. Exits 1 when it is not running |
reoclo tunnel daemon logs [-f] [-n <lines>] | Print the last lines of the log (50 by default). -f keeps printing new lines until Ctrl-C |
reoclo tunnel daemon run | Run it in the foreground. This is what start, launchd and systemd run |
reoclo tunnel daemon install | Start it at login |
reoclo tunnel daemon uninstall | Stop starting it at login |
The daemon starts on its own the first time you run status, add, edit, rm, up or down, and only one daemon runs at a time. A second one exits at once.
Start at login
Section titled “Start at login”install writes a launchd agent on macOS (~/Library/LaunchAgents/com.reoclo.tunneld.plist) or a systemd user unit on Linux (~/.config/systemd/user/reoclo-tunneld.service), then loads it. It points at the path you run, so a Homebrew install uses the reoclo symlink and keeps working after an upgrade. The service restarts the daemon after a crash but not after daemon stop.
The daemon keeps its files in tunnels/ inside the CLI’s configuration directory (~/.reoclo or ~/.config/reoclo, or $REOCLO_CONFIG_DIR):
| File | Contents |
|---|---|
tunnels.yaml | The saved tunnels and which ones are up, plus https_port (default 8443), agent_approvals (required or off, default required), ca_suffixes and manual_hosts |
ca/ca.pem and ca/ca.key | The local CA certificate and its private key, created by tunnel trust |
tunneld.log | The daemon log |
run/tunneld.sock and run/tunneld.pid | The control socket and the process id |
run/shares.json | The process ids of the tailscale serve processes behind shares |
The daemon writes tunnels.yaml. Use the commands above to change tunnels instead of editing the file by hand.
Exit codes
Section titled “Exit codes”| Code | Meaning |
|---|---|
| 0 | The tunnel closed after Ctrl-C |
| 1 | The tunnel failed: refused, limit reached, deadline exceeded, runner gone, or the session wasn’t found |
| 2 | Wrong or missing -L or -R spec, no server given, or a flag mix tunnel add and tunnel edit reject |
Related
Section titled “Related”reoclo hosts: manage the hostnames that point at your tunnels- MCP tunnel tools: let an agent open tunnels
- Local HTTPS for tunnels: a walkthrough from trust to a browser tab
- Tunnels over Tailscale: dial a server over your tailnet and share a tunnel on it
reoclo servers: list and inspect servers- Runner: how the runner connects to Reoclo