Help us shape the future of Go! Take the 2026 Go Developer Survey

proxy

package
v2.7.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNetworkDir added in v2.6.0

func GetNetworkDir(networkID string) string

GetNetworkDir returns the host path of a network's directory (HAProxy files + proxy sockets; also HAProxy's chroot root): /run/archer/<network>.

func GetSocketPath

func GetSocketPath(networkID string, port int32) string

GetSocketPath returns the host path of a proxy socket: /run/archer/<network>/<port>.sock.

Types

type Manager

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

Manager supervises unprivileged socat processes (one per port) per network.

func NewManager

func NewManager(ctx context.Context, startProc ...StartProc) *Manager

NewManager creates a proxy manager. By default it spawns unprivileged socat processes; pass a StartProc (e.g. in tests) to override how proxies are run.

func (*Manager) IsRunning

func (m *Manager) IsRunning(networkID strfmt.UUID) bool

IsRunning reports whether a proxy is supervised for a network.

func (*Manager) StartProxy

func (m *Manager) StartProxy(networkID strfmt.UUID, upstream string, ports []int32)

StartProxy starts the supervised socat processes for a network; idempotent (no-op if already running, mirroring HAProxy).

func (*Manager) StopAll

func (m *Manager) StopAll()

StopAll stops all supervised socat processes.

func (*Manager) StopProxy

func (m *Manager) StopProxy(networkID strfmt.UUID)

StopProxy stops the supervised socat processes for a network and removes its socket(s).

type StartProc added in v2.6.0

type StartProc func(ctx context.Context, networkID strfmt.UUID, upstreamIP string, ports []int32) error

StartProc runs the proxies for a network and blocks until they exit. The default spawns socat; tests inject a stub to avoid needing socat/root.

Jump to

Keyboard shortcuts

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