proxy

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MAX_TLS_CERT_CACHE_SIZE = 10000000

Around 100 MB (1 certificate is 8KB)

Functions

func GenLoggerForProxy

func GenLoggerForProxy(log *loggers.Logger) *loggerForProxy

func SetupProxy

func SetupProxy(config *Config) *goproxy.ProxyHttpServer

Types

type Config

type Config struct {
	DefaultRoute         DefaultRoute
	AlwaysMitm           bool
	Certificate          *tls.Certificate
	Logger               *loggers.Logger
	Router               models.Router
	HttpsHostNames       []string
	InsecureCipherSuites bool
}

type DefaultRoute

type DefaultRoute struct {
	Proxy      *url.URL
	DenyAccess bool `yaml:"deny_access"`
}

type Proxy

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

type ResponseWrite

type ResponseWrite struct {
	*http.Response
	// contains filtered or unexported fields
}

func NewResponseWriter

func NewResponseWriter(req *http.Request) *ResponseWrite

usage: fileRes := NewResponseWriter(req) fileRes implements `http.ResponseWriter` fileRes.res is `*http.Response`

func (*ResponseWrite) Header

func (f *ResponseWrite) Header() http.Header

func (*ResponseWrite) Write

func (f *ResponseWrite) Write(b []byte) (int, error)

func (*ResponseWrite) WriteHeader

func (f *ResponseWrite) WriteHeader(statusCode int)

Jump to

Keyboard shortcuts

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