The proxy API lets your local process communicate directly with services running inside a sprite over encrypted WebSocket tunnels. You can forward a single port, batch-forward multiple ports at once, or open a rawDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/superfly/sprites-go/llms.txt
Use this file to discover all available pages before exploring further.
net.Conn for custom protocols. ProxyManager simplifies lifecycle management when you need to track and tear down several sessions together.
Client methods
ProxyPort
localPort locally and forwards connections to remotePort on the named sprite. Returns the active session or an error if the listener cannot be created.
Context for the lifetime of the proxy session. Cancelling the context closes the session.
Name of the sprite to proxy to.
Local TCP port to listen on (1–65535).
Remote TCP port on the sprite to forward to.
Active proxy session. Call
Close() when done.Non-nil if the local listener could not be bound or the proxy could not be established.
ProxyPorts
Context controlling all sessions created by this call.
Name of the sprite to proxy to.
Slice of
PortMapping structs defining each local-to-remote port pair.One active session per mapping, in the same order as the input slice.
Non-nil if any session could not be established (all sessions are cleaned up on failure).
ProxySocket
net.Conn to an address inside the sprite. The only supported network value is "tcp". The returned connection behaves like any standard net.Conn.
Context for the connection handshake.
Network type. Only
"tcp" is supported.Name of the sprite to connect to.
Host and port in the form
"host:port", e.g., "localhost:5432".Full-duplex connection to the remote address inside the sprite.
Non-nil if the network is unsupported or the WebSocket handshake fails.
Sprite methods
TheSprite type exposes the same proxy methods without requiring the sprite name:
ProxyPort
client.ProxyPort(ctx, sprite.Name(), localPort, remotePort).
ProxyPorts
client.ProxyPorts(ctx, sprite.Name(), mappings).
ProxySocket
client.ProxySocket(ctx, network, sprite.Name(), addr).
ProxySession
ProxySession represents an active port-forwarding listener. It is returned by ProxyPort and ProxyPorts.
Local TCP port the session is listening on.
Remote TCP port on the sprite that connections are forwarded to.
Specific remote host to connect to inside the sprite (e.g.,
"10.0.0.1"). Defaults to "localhost" when empty.Close
Wait
LocalAddr
net.Addr of the local listener, or nil if the session has no listener.
PortMapping
PortMapping describes a single local-to-remote port forwarding rule used with ProxyPorts.
Local TCP port to listen on.
Remote TCP port on the sprite to forward to.
Optional. Specific host inside the sprite to connect to (e.g.,
"10.0.0.1", "fdf::1"). Defaults to "localhost" when empty.ProxyManager
ProxyManager tracks a collection of ProxySession values and provides bulk lifecycle operations.
NewProxyManager
ProxyManager.
AddSession
The proxy session to track.