Control preview traffic, signed URLs, outbound access, and request host masking.
Nullspace preview ingress is designed around short-lived signed URLs and
create-time network policy. Use get_host_info(port) for signed HTTP and
WebSocket URLs, and use network on machine creation for public traffic and
outbound rules.
from nullspace import Machinewith Machine.create(template="base") as machine: info = machine.get_host_info(8080) print(info.host) print(info.url) print(info.websocket_url) print(info.access_token_expires_at)
Field
Meaning
host
Bare host mapping for a machine port.
url
Signed HTTP URL when public edge ingress is active.
websocket_url
Signed WebSocket URL for the same exposed port.
access_token_expires_at
Expiration time for signed edge URLs.
access_token_transport
Token transport; currently query for signed URLs.
Signed URLs are bearer credentials. Anyone with the URL can use it until it
expires, subject to the machine network policy.
The traffic_access_token is returned only at create time. Store it like an
application secret if you need to make later requests through private public
URLs.
Edge-owned ingress uses signed edge_token URLs returned by
get_host_info(). When allow_public_traffic is false, send
x-nullspace-traffic-access-token with that SDK-returned URL. Treat both the
URL token and traffic token as secrets.
Use machine.create_preview_proxy_target(port) when your application proxy
should hold the Nullspace credential instead of sending signed URLs to browsers.
The response includes marker-only upstream URLs, x-nullspace-preview-proxy-token,
HTTP/WebSocket-specific token values, and the forwarded headers your proxy should
preserve.If allow_public_traffic is false, the proxy target response reports that a
traffic token is required and returns the traffic header name. It does not return
the private traffic token value; use the traffic_access_token from machine
creation as a separate upstream header.
Signed WebSocket URLs use the same public edge and access controls as signed
HTTP URLs. Missing edge tokens return 401, expired tokens return 410, and
tokens scoped to the wrong machine, port, or transport return 401.Default SSH access uses the certificate-backed relay, not a signed edge
websocket_url. Use nullspace ssh to mint a short-lived OpenSSH user
certificate for a local public key and connect through the relay:
Direct preview cookies are SameSite=Lax and are intended for top-level browser
navigation, not third-party iframe embedding. Machine X-Frame-Options and
Content-Security-Policy headers pass through to the browser; Nullspace preview
edge does not add an iframe-safe frame policy for direct preview links.Preview CORS remains owned by the machine app or customer-run proxy. No preview
skip-warning, disable-CORS, or skip-activity header is supported by Nullspace
edge in the current launch.