Documentation ¶
Index ¶
- Constants
- func BotDetectionMiddleware(next http.Handler) http.Handler
- func BuildFromConfig(router *mux.Router, config utils.ProxyConfig) *mux.Router
- func GetClientID(r *http.Request) string
- func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool) (*httputil.ReverseProxy, error)
- func RouteTo(route utils.ProxyRouteConfig) http.Handler
- func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination http.Handler) *mux.Route
- func SmartShieldMiddleware(shieldID string, policy utils.SmartShieldPolicy) func(http.Handler) http.Handler
- type SmartResponseWriterWrapper
- func (w *SmartResponseWriterWrapper) Flush()
- func (w *SmartResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (w *SmartResponseWriterWrapper) IsOld() bool
- func (w *SmartResponseWriterWrapper) IsOver() bool
- func (w *SmartResponseWriterWrapper) Write(p []byte) (int, error)
- func (w *SmartResponseWriterWrapper) WriteHeader(status int)
Constants ¶
View Source
const ( STRIKE = 0 TEMP = 1 PERM = 2 )
Variables ¶
This section is empty.
Functions ¶
func BotDetectionMiddleware ¶
botDetectionMiddleware checks if the User-Agent is a known bot
func BuildFromConfig ¶
func GetClientID ¶
func NewProxy ¶
func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool) (*httputil.ReverseProxy, error)
NewProxy takes target host and creates a reverse proxy
func SmartShieldMiddleware ¶
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 (w *SmartResponseWriterWrapper) Hijack() (net.Conn, *bufio.ReadWriter, error)
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)
Click to show internal directories.
Click to hide internal directories.