Overview
Updated at:
Network is used to access services running inside the sandbox. The common pattern is to start an HTTP service in the sandbox and then call sandbox.getHost(port) to get a publicly accessible URL.
Basic workflow
Start a service inside the sandbox and make it listen on a specific port.
Call
sandbox.getHost(port)to get the access host.Access that port over HTTPS or WebSocket.
const server = await sandbox.commands.run("python3 -m http.server 8000", {
background: true,
});
const host = sandbox.getHost(8000);
console.log(`https://${host}`);
await sandbox.commands.kill(server.pid);Python example:
server = sandbox.commands.run(
"python3 -m http.server 8000",
background=True,
)
host = sandbox.get_host(8000)
print(f"https://{host}")
sandbox.commands.kill(server.pid)Capability boundaries
The current feature documentation only treats public access URLs as part of the formal compatibility surface. E2B network access control and proxy tunneling should not be copied directly into the FC Agent Sandbox integration path. Custom domains belong to the FC Extensions capability set. See Custom Domains.
Is this page helpful?