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.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.Masking request host headers
You can customize theHost 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.
${PORT} variable in the mask will be automatically replaced with the actual port number of the requested service.
Connecting to HTTPS servers inside the sandbox
By default, the E2B proxy connects to the service inside the sandbox over plain HTTP. If the service listening on a port serves HTTPS (TLS) itself, list that port in thehttpsPorts / https_ports option so the proxy connects to it over HTTPS instead. The public URL is HTTPS either way.
httpsPorts / https_ports keep being proxied over plain HTTP.
This is not TLS passthrough. Requests to the public URL are still terminated at the E2B proxy and re-encrypted on the hop to the sandbox, so public access restrictions and request host masking apply to HTTPS ports as well.
network field of the sandbox info (getInfo() / get_info()), and cannot be changed after the sandbox is created.