protocol

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ChannelHTTP is a custom channel type for forwarding HTTP requests.
	// The server opens this channel toward the client for each incoming request.
	ChannelHTTP = "gatecrash-http"

	// ChannelDirectTCPIP is the standard SSH direct-tcpip channel (RFC 4254 Section 7.2).
	// Used for raw TCP port forwarding.
	ChannelDirectTCPIP = "direct-tcpip"

	// ChannelControl is a long-lived channel for heartbeat and metadata exchange.
	// Opened by the client immediately after SSH connection.
	ChannelControl = "gatecrash-control"

	// ChannelDiagnostic is opened by the server toward the client to run
	// latency and throughput diagnostics on the tunnel link itself.
	ChannelDiagnostic = "gatecrash-diagnostic"
)

SSH channel type constants.

View Source
const (
	ControlHeartbeat       = "heartbeat"
	ControlClientInfo      = "client_info"
	ControlUpdateAvailable = "update_available"
)

Control message types.

View Source
const (
	DiagPing     = "ping"
	DiagPong     = "pong"
	DiagDownload = "download" // server tells client to read N bytes of payload
	DiagUpload   = "upload"   // server tells client to send N bytes of payload
	DiagResult   = "result"   // client confirms completion
)

Diagnostic message types exchanged over ChannelDiagnostic as length-prefixed JSON.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientInfo

type ClientInfo struct {
	Version  string `json:"version"`
	OS       string `json:"os"`
	Arch     string `json:"arch"`
	Hostname string `json:"hostname"`
}

ClientInfo is sent by the client on the control channel after connecting.

type ControlMessage

type ControlMessage struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data,omitempty"`
}

ControlMessage is exchanged over the control channel as JSON with a 4-byte length prefix.

type DiagMessage added in v0.8.9

type DiagMessage struct {
	Type string `json:"type"`
	Size int    `json:"size,omitempty"` // payload size for download/upload
	Seq  int    `json:"seq,omitempty"`  // sequence number for ping/pong
}

DiagMessage is a single diagnostic command/response.

type DirectTCPIPData

type DirectTCPIPData struct {
	DestAddr   string
	DestPort   uint32
	OriginAddr string
	OriginPort uint32
}

DirectTCPIPData is the standard SSH direct-tcpip extra data (RFC 4254).

type HTTPChannelData

type HTTPChannelData struct {
	RequestID    string
	Method       string
	URI          string
	Host         string
	RemoteAddr   string
	TLS          bool
	PreserveHost bool
}

HTTPChannelData is sent as extra data when the server opens a gatecrash-http channel.

Jump to

Keyboard shortcuts

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