Expose a port
Reach a server inside the container — on your own machine, or from the public internet
"Expose a port" means two different things, and most of the time you want the easy one:
- Reach it yourself — a dev server the agent is running inside its container should just show up at
http://localhost:5173on your machine. This needs zero setup — it already works. - Let the outside in — a public
https://…URL that GitHub's webhooks, or a friend, can reach. This is what a tunnel is for, and you set it up with one command.
Reach a server on your own machine
Nothing to do. When the agent starts a dev server inside its container — say a Vite app on port 5173 — TypeClaw automatically makes it appear at http://localhost:5173 on your machine. Open it in your browser; the agent's server answers.
This even works for servers that only bind to "localhost" inside the container (plain vite, next dev), which a normal Docker port mapping can't reach. You don't have to do anything for it.
Give it a public URL
When something outside your network needs to reach the agent — GitHub delivering webhooks is the classic case — you need a public URL, because your container sits behind your router. That's a tunnel.
Tunnels are set up from the command line (this one's on you, not the agent):
typeclaw tunnel add demo --provider cloudflare-quick --upstream-port 5173
typeclaw restartThat gives you a free https://…trycloudflare.com URL — no signup, no account — pointing at port 5173 inside the container. Manage it with:
typeclaw tunnel list
typeclaw tunnel status demo
typeclaw tunnel logs demo
typeclaw tunnel remove demoFor GitHub, the channel wizard does this for you
If the public URL is for GitHub webhooks, you don't set the tunnel up separately — typeclaw channel add github
offers to create one as part of wiring the channel, and keeps it pointed at the right place automatically even when
the URL rotates. See Add a channel and the Code reviewer
recipe.
One trap: tunnel the real server, not a proxy in front of it
A few things (the bundled agent-browser dashboard is the example) run a small proxy on one port and the actual
server on another. Point the tunnel at the actual server's port. Tunnel the proxy by mistake and everything looks
fine until requests mysteriously time out.
Going deeper
Next: Deploy — what changes when the agent isn't running on your laptop anymore.