Open a TCP tunnel to a port inside the sandbox.
Creates a local TCP listener that forwards connections through a yamux-multiplexed WebSocket to the specified port inside the sandbox. Works with any TCP protocol (databases, Redis, HTTP, etc.).
Usage::
async with await sandbox.tunnel(remote_port=5432) as t:
conn = await asyncpg.connect(host="127.0.0.1", port=t.local_port)
TCP port inside the sandbox to tunnel to (1-65535).
Local port to listen on. Defaults to mirroring remote_port. Use 0 to let the OS pick an available port.
Maximum number of automatic reconnect attempts when the WebSocket session drops. Set to 0 to disable.