Mocko Cloud
Local Tunnels
A Local Tunnel connects a port on your machine to your Cloud project. Requests to your public host reach the service you are running locally, and your mocks still apply on top. It is a way to put a real, in-progress backend behind the same URL your team already uses.
Why tunnel instead of proxy
A project's proxy URL reaches a backend that is already accessible on the internet. A tunnel is for the backend that is not: a service on localhost behind your firewall or NAT. The tunnel opens a secure connection outward from your machine, so the Cloud can forward requests to it without you exposing a port.
Because your mocks sit in front of the tunnel, you can override individual endpoints of a local service without touching its code, and watch every request that flows through in Request Logs.
Install the tunnel client
The tunnel runs as a small command-line client, installed globally from npm:
It exposes two equivalent commands, mocko-tunnel and the shorter mlt.
Get your tunnel token
A token authorizes the client to connect to your project. Open the Tunnels view in the control panel, enable Local Tunnel for the project, and copy the generated token. The token belongs to the project, so anyone with it can tunnel into that host: treat it like a secret.
Open the tunnel
Point the client at the local port you want to expose. If your service runs on port 8080:
The client prompts for the token the first time. You can also pass it directly, which is handy in scripts:
While the tunnel is open, requests to your public host that no mock handles are delivered to your local service on port 8080. Stop the client and the tunnel closes.