tunnelclient

package
v0.3.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

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

View Source
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

func Dial(ctx context.Context, baseURL string, rt http.RoundTripper, port int) (net.Conn, error)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL