proxy

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package proxy configures a SOCKS5 proxy that is actually an SSH tunnel. A proxy is used for one domain only and should have a unique port. There is self-checking logic to ensure that the proxy is running and reachable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// Name of the installation/management cluster this proxy is for.
	Name string
	// Proxy port
	Port int
	// Domain the proxy should be used for.
	Domain string
	// CheckEndpoint is the endpoint to ping for this proxy
	CheckEndpoint string
	// contains filtered or unexported fields
}

func New

func New(logger *slog.Logger, name string, domain string, checkEndpoint string) (*Proxy, error)

func (*Proxy) IsHealthy added in v0.4.0

func (p *Proxy) IsHealthy() bool

IsHealthy returns whether the proxy is currently healthy.

func (*Proxy) Ping added in v0.2.0

func (p *Proxy) Ping(ctx context.Context) bool

Ping performs a GET request to the root URL of the provided host. It returns information about the success, response code, any errors, and the duration.

func (*Proxy) PingConstantly added in v0.2.0

func (p *Proxy) PingConstantly()

func (*Proxy) Start added in v0.2.0

func (p *Proxy) Start() error

Start creates the SSH tunnel and thus starts the proxy.

func (*Proxy) Status added in v0.4.0

func (p *Proxy) Status() ProxyStatus

Status returns the current status of the proxy.

func (*Proxy) Stop added in v0.2.0

func (p *Proxy) Stop() error

type ProxyStatus added in v0.4.0

type ProxyStatus struct {
	Name       string
	Domain     string
	Port       int
	Healthy    bool
	ActiveNode string
	NodeCount  int
}

ProxyStatus represents the current status of a proxy for display purposes.

Jump to

Keyboard shortcuts

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