Documentation
¶
Index ¶
- Constants
- type Config
- type HandlerDialer
- type ProxyHandler
- func (s *ProxyHandler) HandleGetRandom(wr http.ResponseWriter, req *http.Request, username string)
- func (s *ProxyHandler) HandleRequest(wr http.ResponseWriter, req *http.Request, username string)
- func (s *ProxyHandler) HandleTunnel(wr http.ResponseWriter, req *http.Request, username string)
- func (s *ProxyHandler) ServeHTTP(wr http.ResponseWriter, req *http.Request)
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 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)
Click to show internal directories.
Click to hide internal directories.