proxy

package
v0.0.0-...-3f81719 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AllowedHost

type AllowedHost struct {
	Host string `json:"host"`
	Port int    `json:"port"`
}

func (AllowedHost) Allow

func (a AllowedHost) Allow(req *socks5.Request) bool

type AllowedProxyTargets

type AllowedProxyTargets []AllowedHost

func (AllowedProxyTargets) Allow

func (a AllowedProxyTargets) Allow(ctx context.Context, req *socks5.Request) (context.Context, bool)

type Config

type Config struct {
	HttpPort            int                 // What port should this server listen for HTTP/websocket connections on (0 == disabled)
	TcpPort             int                 // What port should this server listen for raw TCP connections on (0 == disabled)
	AuthKeys            auth.Keys           // What auth keys can be used when talking with this Emissary server
	AllowedProxyTargets AllowedProxyTargets // What proxy targets are allowed through this Emissary server
	DNSServers          []string            // The DNS server IPs to use; nil means the system default
	HealthPath          string              // The path to use for health checks
}

func LoadConfig

func LoadConfig(_ context.Context) (*Config, error)

LoadConfig performs setup for the proxy layer and returns an error if we cannot initialise

func (*Config) ServeConn

func (cfg *Config) ServeConn(conn net.Conn) error

ServeConn takes a connection and runs the emissary proxy on it

Jump to

Keyboard shortcuts

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