Skip to main content
Every sandbox can be reached by a public URL, which lets you expose and connect to services running inside it. This page covers how to get that URL, connect to a server inside the sandbox, and customize the Host header services receive. To control the sandbox’s outbound internet access, see Internet access. To require authentication on the public URL, see Restricting public access.

Sandbox public URL

Every sandbox has a public URL that can be used to access running services inside the sandbox.
The code above will print something like this:
The first leftmost part of the host is the port number we passed to the method.

Connecting to a server running inside the sandbox

You can start a server inside the sandbox and connect to it using the approach above. In this example we will start a simple HTTP server that listens on port 3000 and responds with the content of the directory where the server is started.
This output will look like this:

Masking request host headers

You can customize the Host header that gets sent to services running inside the sandbox using the maskRequestHost / mask_request_host option. This is useful when your application expects a specific host format.
The ${PORT} variable in the mask will be automatically replaced with the actual port number of the requested service.