handler

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2025 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const HintsHeaderName = "X-Src-IP-Hints"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v1.14.1

type Config struct {
	// Dialer optionally specifies dialer to use for creating
	// connections originating from proxy.
	Dialer HandlerDialer
	// Auth optionally specifies request validator used to verify users
	// and return their username.
	Auth auth.Auth
	// Logger specifies optional custom logger.
	Logger *clog.CondLogger
	// Forward optionally specifies custom connection pairing function
	// which does actual data forwarding.
	Forward func(ctx context.Context, username string, incoming, outgoing io.ReadWriteCloser) error
	// UserIPHints specifies whether allow IP hints set by user or not
	UserIPHints bool
}

type HandlerDialer

type HandlerDialer interface {
	DialContext(ctx context.Context, net, address string) (net.Conn, error)
}

type ProxyHandler

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

func NewProxyHandler

func NewProxyHandler(config *Config) *ProxyHandler

func (*ProxyHandler) HandleGetRandom added in v1.28.0

func (s *ProxyHandler) HandleGetRandom(wr http.ResponseWriter, req *http.Request, username string)

func (*ProxyHandler) HandleRequest

func (s *ProxyHandler) HandleRequest(wr http.ResponseWriter, req *http.Request, username string)

func (*ProxyHandler) HandleTunnel

func (s *ProxyHandler) HandleTunnel(wr http.ResponseWriter, req *http.Request, username string)

func (*ProxyHandler) ServeHTTP

func (s *ProxyHandler) ServeHTTP(wr http.ResponseWriter, req *http.Request)

Jump to

Keyboard shortcuts

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