tunnelproto

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package tunnelproto is the wire protocol between the agent and the server over the tunnel an agent holds open. Both sides import it, so a value here changes on both at once; a changed value is still a wire-incompatible change for released agents.

Index

Constants

View Source
const (
	ConnectionV1Path = "/ssh/connection"
	ConnectionV2Path = "/agent/connection"
	RevdialPath      = "/ssh/revdial"
)

The endpoints an agent opens its tunnel at. V1 carries a revdial connection, whose every logical stream needs one more HTTP handshake at RevdialPath; V2 carries yamux, whose streams are negotiated with multistream-select.

View Source
const (
	ProtoSSHOpen   = "/ssh/open/1.0.0"
	ProtoSSHClose  = "/ssh/close/1.0.0"
	ProtoHTTPProxy = "/http/proxy/1.0.0"
)

The multistream protocols of a V2 stream.

View Source
const (
	SSHOpenPathV1   = "/ssh/"
	SSHClosePathV1  = "/ssh/close/"
	HTTPProxyPathV1 = "/http/proxy/"
)

The request paths of a V1 stream. A session path ends with the session ID; the proxy path, sent with CONNECT, with the host:port the agent dials.

View Source
const StatusOK = "ok"

StatusOK is the Reply.Status of a proxy stream whose target the agent reached.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header struct {
	ID   string `json:"id"`
	Host string `json:"host,omitempty"`
	Port string `json:"port,omitempty"`
}

Header is the JSON frame the server writes on a V2 stream before its payload. ID names the session or the proxied request; Host and Port are the proxy's target.

type Reply

type Reply struct {
	Status string `json:"status,omitempty"`
	Error  string `json:"error,omitempty"`
}

Reply is the JSON frame the agent answers a V2 proxy stream with before the proxied bytes: Status StatusOK, or the Error that kept it from reaching the target. The encoder ends the frame with a newline the reader must skip.

Jump to

Keyboard shortcuts

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