Documentation
¶
Overview ¶
Package tunnelclient dials clank-host's GET /tunnel/{port} endpoint and adapts the WebSocket to a net.Conn carrying the raw TCP bytes of a port on the host's loopback.
Provisioners use it to implement OpenInternalConn on providers whose edge only routes declared service ports (e.g. Fly Machines behind a Flycast address), where a provider-side TCP-proxy primitive doesn't exist. The server side is internal/host/mux's tunnel handler; auth rides the same chain as every other host request (HostRef.Transport).
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrPortUnreachable = errors.New("tunnelclient: target port unreachable on host")
ErrPortUnreachable reports that clank-host answered but could not dial the requested loopback port — the dev server isn't listening (yet). Gateways map this to a 502 toward the client rather than treating the host as unreachable.
Functions ¶
func Dial ¶
Dial opens a TCP-over-WebSocket tunnel to (port) on the loopback of the host at baseURL. rt carries the full auth chain to reach the host (typically HostRef.Transport). ctx bounds the dial only; the returned conn lives until Close — required because callers like previewtunnel cancel their dial context the moment the dial returns.
Types ¶
This section is empty.