proxy

package
v0.15.1-unstable3 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STRIKE = 0
	TEMP   = 1
	PERM   = 2
)

Variables

This section is empty.

Functions

func BotDetectionMiddleware

func BotDetectionMiddleware(next http.Handler) http.Handler

botDetectionMiddleware checks if the User-Agent is a known bot

func BuildFromConfig

func BuildFromConfig(router *mux.Router, config utils.ProxyConfig) *mux.Router

func CleanUp added in v0.15.0

func CleanUp()

func GetActiveProxies added in v0.15.0

func GetActiveProxies() map[string]chan bool

func GetClientID

func GetClientID(r *http.Request) string

func GetShield added in v0.15.0

func GetShield() int

func InitInternalTCPProxy added in v0.14.0

func InitInternalTCPProxy()

func NewProxy

func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool, VerboseForwardHeader bool, DisableHeaderHardening bool, CORSOrigin string, route utils.ProxyRouteConfig) (*httputil.ReverseProxy, error)

NewProxy takes target host and creates a reverse proxy

func RouteTo

func RouteTo(route utils.ProxyRouteConfig) http.Handler

func RouterGen

func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination http.Handler) *mux.Route

func SmartShieldMiddleware

func SmartShieldMiddleware(shieldID string, route utils.ProxyRouteConfig) func(http.Handler) http.Handler

Types

type SmartResponseWriterWrapper

type SmartResponseWriterWrapper struct {
	http.ResponseWriter
	ClientID     string
	Status       int
	Bytes        int64
	ThrottleNext int
	TimeStarted  time.Time
	TimeEnded    time.Time
	RequestCost  int
	Method       string
	// contains filtered or unexported fields
}

func (*SmartResponseWriterWrapper) Flush

func (w *SmartResponseWriterWrapper) Flush()

func (*SmartResponseWriterWrapper) Hijack

func (*SmartResponseWriterWrapper) IsOld

func (w *SmartResponseWriterWrapper) IsOld() bool

func (*SmartResponseWriterWrapper) IsOver

func (w *SmartResponseWriterWrapper) IsOver() bool

func (*SmartResponseWriterWrapper) Write

func (w *SmartResponseWriterWrapper) Write(p []byte) (int, error)

func (*SmartResponseWriterWrapper) WriteHeader

func (w *SmartResponseWriterWrapper) WriteHeader(status int)

Jump to

Keyboard shortcuts

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