http2socks

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2023 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HTTPMetricGroupName = "HTTP proxy"

	HTTPRequests     = metrics.RegisterMetric(HTTPMetricGroupName, "Requests")
	HTTPConnErrors   = metrics.RegisterMetric(HTTPMetricGroupName, "ConnErrors")
	HTTPSchemeErrors = metrics.RegisterMetric(HTTPMetricGroupName, "SchemeErrors")
)

Functions

func NewHTTPServer

func NewHTTPServer(listenAddr string, proxy *Proxy) *http.Server

NewHTTPServer returns a new HTTP proxy server.

func TransportProxyFunc

func TransportProxyFunc(proxy string) func(*http.Request) (*url.URL, error)

TransportProxyFunc returns the Proxy function used by http.Transport.

Types

type Proxy

type Proxy struct {
	ProxyURI string
}

func (*Proxy) ServeHTTP

func (p *Proxy) ServeHTTP(res http.ResponseWriter, req *http.Request)

ServeHTTP implements http.Handler interface with a socks5 backend.

Jump to

Keyboard shortcuts

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