proxy

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package proxy provides an HTTPS/HTTP3 server that forwards CLI commands to a backend network device over SSH. This is the "site proxy" pattern: automation talks HTTPS over the WAN, the proxy talks SSH over a low-latency campus link.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an HTTPS proxy that forwards commands to a backend SSH device.

func New

func New(addr, backendAddr, user, pass string, pooled bool) *Server

New creates a proxy server. If pooled is true, one SSH connection is reused across requests; otherwise each request gets a fresh one.

func (*Server) Addr

func (s *Server) Addr() string

Addr returns the listener's address, or "" if not yet listening.

func (*Server) Close

func (s *Server) Close() error

Close stops the proxy server and releases all resources.

func (*Server) ListenAndServeH3 added in v0.3.0

func (s *Server) ListenAndServeH3() error

ListenAndServeH3 starts the proxy as an HTTP/3 server.

func (*Server) ListenAndServeTLS

func (s *Server) ListenAndServeTLS() error

ListenAndServeTLS starts the HTTPS proxy.

func (*Server) RunCommands added in v0.4.0

func (s *Server) RunCommands(cmds []string) (string, error)

RunCommands implements httphandler.Runner by forwarding to SSH backend.

func (*Server) SetListener

func (s *Server) SetListener(ln net.Listener)

SetListener sets a custom net.Listener (e.g., with latency injection).

func (*Server) SetPacketConn added in v0.3.0

func (s *Server) SetPacketConn(conn net.PacketConn)

SetPacketConn sets a custom net.PacketConn for HTTP/3 serving.

Jump to

Keyboard shortcuts

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