Skip to main content
Configure one SOCKS4 or SOCKS5 proxy for outbound sandbox traffic. The guest connects to its normal destination; microsandbox routes eligible traffic through the proxy on the host.
Outbound proxies are local-only. Cloud sandbox creation rejects this setting.

Supported proxies

Only one proxy can be configured for a sandbox. A SOCKS4 user ID identifies the caller; it is not a password.

Configure a proxy

SDK addresses use IP:port. The msb run and msb create commands accept --proxy socks4://IP:port or --proxy socks5://IP:port. Proxy URIs reject user information, paths, query parameters, and fragments; protocol-specific authentication uses separate CLI flags.

SOCKS4 user ID

Add an optional user ID through an SDK or --socks4-user-id in the CLI.
The user ID must contain 1–255 bytes and cannot contain a null byte. Omit it to use SOCKS4 without a user ID.

SOCKS5 credentials

SOCKS5 supports optional username/password authentication. Passwords are loaded from a host environment variable rather than placed directly in configuration.
Environment variables are currently the only supported password source. The password is read from the host environment once each time the sandbox starts and reused for that run. Changing the environment variable affects the next start, not a sandbox that is already running. The username and resolved password must each contain 1–255 bytes; startup fails if the environment variable is missing, empty, or invalid. Durable configuration and the database store the environment-variable reference, such as SOCKS5_PASSWORD, but never the resolved password. SOCKS5 authentication does not encrypt credentials on the wire. Use a trusted local or private proxy, or protect the connection at the transport layer.

Behavior and limits

  • Network policy is evaluated against the sandbox’s actual destination before the proxy connection is opened.
  • SOCKS4 supports TCP only and cannot reach IPv6 destinations. Non-DNS UDP is blocked while SOCKS4 is configured.
  • SOCKS5 uses CONNECT for TCP and UDP ASSOCIATE for non-DNS UDP.
  • DNS uses microsandbox’s DNS forwarder instead of the configured proxy. This includes plain DNS, DNS-over-TCP, and DNS-over-TLS.
  • Connections to host.microsandbox.internal bypass the proxy and continue to target the microsandbox host.
  • Each TCP connection opens its own proxy connection and handshake. Each UDP flow opens its own SOCKS5 control connection and UDP association.
  • TLS interception and secret injection continue to work as configured.

Reference

For exact proxy APIs, see TypeScript, Rust, Python, or Go. For CLI flags, see Sandbox commands.