leash

package
v0.0.0-...-e33ee5f Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2026 License: MIT Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package leash implements the Orthrus agent's reverse WebSocket tunnel.

The Leash maintains a persistent connection from the agent to the Charon server, multiplexing Docker socket streams over a single WebSocket connection using yamux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewWSNetConn

func NewWSNetConn(conn *websocket.Conn) net.Conn

NewWSNetConn wraps conn as a net.Conn suitable for use with yamux.

Types

type Config

type Config struct {
	ServerURL    string
	AuthKey      string
	AgentID      string
	DockerSock   string
	Log          *logrus.Logger
	InitialDelay time.Duration // 0 = use default 5s; exposed for testing
}

Config holds the configuration for a Leash connection.

type Leash

type Leash struct {
	// contains filtered or unexported fields
}

Leash manages the reverse WebSocket tunnel to the Charon server.

Leash intentionally holds no *muzzle.Filter field: the filter is connection-scoped, not process-scoped (see connect), so a mid-connection write-mode toggle on the operator's side can't retroactively change an already-negotiated session. Each call to connect constructs a fresh Filter and closes over it for the lifetime of that one connection.

func New

func New(cfg Config) *Leash

New creates a Leash from cfg.

func (*Leash) Run

func (l *Leash) Run(ctx context.Context) error

Run dials the server and reconnects with exponential backoff on failure. It returns when ctx is cancelled.

Jump to

Keyboard shortcuts

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