Prerequisites
- An API key from the console, exported as
BOXLITE_API_KEY. See API keys. pip install boxlite, and the REST URL exported asBOXLITE_REST_URL. See Quickstart.- A box you can start, and a service inside it that listens on a TCP port.
connect() hands you the byte stream directly. This is the level you work at for a protocol that is not HTTP — a line protocol, a binary framing, a database wire protocol — or when you want full control over what goes on the wire.
read(max_bytes) returns up to max_bytes bytes and an empty bytes object once the far side has closed. max_bytes of 0 raises ValueError: max_bytes must be non-zero, and reading after close() raises a BoxLite error carrying connection is closed.
A synchronous surface exists as well: SyncBox.network and SyncBox.tunnel(port) return the SyncNetworkHandle and SyncTunnelForwarder equivalents of the classes documented here.
Next steps
Network
How tunnels work, the full parameter reference, and the outbound boundary.
Network policy
Control what the box itself is allowed to reach.

