server

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: GPL-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNilConfig                  = errors.New("nil config parameter supplied")
	ErrDuplicateListeners         = errors.New("duplicate listener addr and port but different type")
	ErrUnknownListenerType        = errors.New("unknown listener type")
	ErrListenerNotFound           = errors.New("listener not found")
	ErrProxychainNotFound         = errors.New("proxychain for backend is not defined")
	ErrBackendInitFailed          = errors.New("backend initialization is not defined")
	ErrHostListenerClash          = errors.New("duplicate host already attached to listener")
	ErrAttachSiteToListenerFailed = errors.New("failed to attach site to listener")
)
View Source
var (
	ErrDirectProxyAfterNonDirectProxy = errors.New("direct connection does not make sense as non-first member of proxychain")
)

Functions

func Server

func Server(ctx context.Context, assets assets.Config, sc ServerCommand, cfg *config.Config) error

Server implements the Pathfinding Proxy Server.

Types

type ErrInvalidProxySpec

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

ErrInvalidProxySpec is the common type for proxy construction errors.

func (ErrInvalidProxySpec) Cause

func (e ErrInvalidProxySpec) Cause() error

func (ErrInvalidProxySpec) Error

func (e ErrInvalidProxySpec) Error() string

type HTTPBackend

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

func NewHTTPBackend

func NewHTTPBackend(config config.BackendConfig, proxychain Proxychain) (*HTTPBackend, error)

func (HTTPBackend) ServeHTTP

func (h HTTPBackend) ServeHTTP(writer http.ResponseWriter, request *http.Request)

ServerHTTP implements http.Handler.

type HTTPEdgeListener

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

func (*HTTPEdgeListener) AddSite

func (l *HTTPEdgeListener) AddSite(host string, backend http.Handler) error

type Listener

type Listener interface {
	AddSite(host string, backend http.Handler) error
}

func NewHTTPEdgeListener

func NewHTTPEdgeListener(ctx context.Context, cfg listenerKey) (Listener, error)

type Proxychain

type Proxychain interface {
	Dialer() proxy.ContextDialer
}

Proxychain provides an interface to constructed chains of proxies.

func NewProxychainFromConfig

func NewProxychainFromConfig(cfg []config.Proxy) (Proxychain, error)

NewProxychainFromConfig creates a new proxychain from the supplied list of configs.

type ServerCommand

type ServerCommand struct{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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