Ports, URLs and SSH
Open a sandbox's ports to the web, share them for a while, reach them raw, and sign in by SSH
Every port has a URL
Not available yet Public addresses for a sandbox's ports are not served yet.
Anything that listens in a sandbox has an address on Pod's content domain, mapier.dev, a domain of its own apart from the API and the dashboard, so one sandbox's pages can never read another's cookies or Pod's. A port's URL looks like https://3000-c7k….mapier.dev, and a chosen name's like https://my-app--c7k.mapier.dev. No custom domain can be on mapier.dev. List a sandbox's ports for their URLs, and see what listens now. Use the URLs Pod answers; never build one.
A port is private until you say otherwise: its URL opens only for a key holding sandboxes:exec, the port's token, a share link, or the browser session one of those gave. Make it public and it opens for anyone. The same call gives it a chosen name, a second URL that stays the same when you make a new sandbox: 3 to 40 lowercase letters, digits and single hyphens, starting with a letter and ending with a letter or digit, not a reserved name such as www, api or app, and unique in the cell.
On a sandbox made with no_save, only the key that made it can share a port: making the port public, making its token or making a share link is refused to every other key with saves_refused. Making a port private, naming it and resetting it stay open to the project, and a private port still opens for any key holding sandboxes:exec.
Tokens and share links carry a secret in the URL
A URL that opens a private port is a password. Treat it like one.
- The port's token starts
podpt_. Make one; it is shown once and Pod keeps only a hash. A program sends it in thePod-Port-Tokenheader. Each call makes a new token, which ends every share link and session made before: that is how you revoke a leaked one. - A share link is the port's URL with
?pod_share=…, signed by the cell. Make one for a minute up to 7 days (24 hours by default). Anyone holding it opens the port until it expires. Pod keeps nothing, so a link is ended only by a new token or by resetting the port.
When a browser opens a URL carrying pod_share or pod_token, Pod answers with a redirect to the same URL without it and a session cookie for that one host, at most 12 hours and never past the link. The secret leaves the address bar before the sandbox's page loads, so it does not reach that page's scripts, its referrer or the browser's history. Pod also strips every credential from the request before it reaches the sandbox, on public ports too.
Still:
- Send a link only to the people it is for, and pick the shortest lifetime that works.
- Never paste one into an issue, a chat channel or a log: anyone who reads it can open the port until it expires.
- Revoke a link that leaked by making a new token at once.
- An open WebSocket on a port URL is checked again every 30 seconds and closed once its credential is gone.
A raw connection
Connect to a port over a WebSocket and its binary frames are the bytes of one TCP connection, each way, or one UDP datagram each with protocol=udp. A port nothing listens on is refused with port_closed. It takes a key in the Authorization header, so it runs from a server, an SDK or mpod, never from a browser.
SSH
Every cell has one SSH endpoint. Read a sandbox's for its host, port 22 and the login, which is the sandbox's id ({id}+{user} runs as that user):
ssh sbx_…@ssh.<cell>.<domain>Signing in takes an SSH key you added to your account and a role that holds sandboxes:exec in the sandbox's project. The key is yours, not the organization's: it signs in to every sandbox your role reaches, in each organization you belong to. Adding one asks for a fresh second factor; removing one does not, so a lost key goes at once, and Pod refuses it within a minute.
No SSH server or key is needed in the sandbox, so every image works, VS Code and Cursor Remote-SSH included. Commands, shells, sftp, ssh -L and ssh -R to the sandbox's own loopback work; password sign-in, agent and X11 forwarding do not. No API key signs in by SSH.