SandboxBuilder::proxy(). Proxy protocols are mutually exclusive.
See Proxies for routing behavior, security considerations, and limits.
Outbound proxies are local-only. Cloud sandbox creation rejects this setting.
Typical flow
SandboxBuilder
proxy()
OutboundProxyBuilder and must return one protocol-specific builder.
Invalid proxy configuration is retained by the sandbox builder and returned from build() or create() as MicrosandboxError::NetworkBuilder(BuildError::InvalidOutboundProxy).
OutboundProxyBuilder
Protocol selector passed toSandboxBuilder::proxy().
http_connect()
IP:port. It supports TCP only. Use the returned builder to enable optional HTTP Basic authentication.
socks4()
IP:port. The returned builder can optionally set a user ID.
socks5()
IP:port. The parent sandbox builder validates and materializes the returned Socks5ProxyBuilder.
Socks4ProxyBuilder
Protocol-specific builder returned byOutboundProxyBuilder::socks4().
user_id()
Socks5ProxyBuilder
Protocol-specific builder returned byOutboundProxyBuilder::socks5(). It carries the proxy address and is finalized when returned from the .proxy() callback.
credentials()
SecretSource::env("SOCKS5_PASSWORD") as password; store-backed sources are not supported for proxy credentials. The username and resolved password must each contain 1–255 bytes.
The host environment variable is read once each time the sandbox starts. Changing it affects the next start, not a sandbox that is already running. config_json() and the database contain the source reference but never the resolved password.
HttpConnectProxyBuilder
Protocol-specific builder returned byOutboundProxyBuilder::http_connect(). It carries the proxy address and is finalized when returned from the .proxy() callback.
credentials()
SecretSource::env("HTTP_CONNECT_PASSWORD") as password; store-backed sources are not supported for proxy credentials. HTTP Basic permits an empty username for token-only authentication; a non-empty username must not contain : or control characters. The resolved password must not be empty.
The host environment variable is read once each time the sandbox starts. Changing it affects the next start, not a sandbox that is already running. config_json() and the database contain the source reference but never the resolved password.
SecretSource
env()
SecretSource from microsandbox.
OutboundProxy
Declarative outbound proxy configuration stored in the sandbox’s durable network specification.Socks5Credentials and HttpConnectCredentials contain a password source, not the resolved password.
HttpConnectCredentials
Environment-backed username and password reference stored onOutboundProxy::HttpConnect. It holds the username and a host environment variable name, never the resolved password. Create it through HttpConnectProxyBuilder::credentials().