CoreIntroduction
Presigned URLs
Share a sandbox port through a temporary public hostname.
A presigned URL is a temporary public hostname that routes traffic to a specific port inside a sandbox.
The URL format is: https://<token>.leap0.app
The token is only returned once when the URL is created. Leap0 stores only a SHA-256 hash of that token server-side.
Create a presigned URL
Create a presigned URL with:
from leap0 import Leap0Client
client = Leap0Client()
sandbox = client.sandboxes.create()
presigned_url = sandbox.create_presigned_url(port=8080, expires_in=900)
print(presigned_url.id)
print(presigned_url.url)
# Treat the token as a secret. Do not log or commit it.
token = presigned_url.token
client.close()import { Leap0Client } from "leap0";
const client = new Leap0Client();
const sandbox = await client.sandboxes.create();
const presignedUrl = await sandbox.createPresignedUrl(8080, 900);
console.log(presignedUrl.id);
console.log(presignedUrl.url);
// Treat the token as a secret. Do not log or commit it.
const token = presignedUrl.token;
await client.close();Delete a presigned URL
Revoke a URL with:
from leap0 import Leap0Client
client = Leap0Client()
sandbox = client.sandboxes.create()
presigned_url = sandbox.create_presigned_url(port=8080)
sandbox.delete_presigned_url(presigned_url.id)
client.close()import { Leap0Client } from "leap0";
const client = new Leap0Client();
const sandbox = await client.sandboxes.create();
const presignedUrl = await sandbox.createPresignedUrl(8080);
await sandbox.deletePresignedUrl(presignedUrl.id);
await client.close();Notes
- Presigned URLs are public and do not require an API key.
- Treat presigned URLs and their one-time tokens as secrets. Avoid logging or committing them.
- Each URL maps to one sandbox port.
- Expired URLs stop resolving automatically.
- If the sandbox is paused, Leap0 resumes it before proxying the request.
Was this page helpful?

