Documentation ¶
Index ¶
- Constants
- func AddConstellationToken(route utils.ProxyRouteConfig) func(next http.Handler) http.Handler
- func BotDetectionMiddleware(next http.Handler) http.Handler
- func BuildFromConfig(router *mux.Router, config utils.ProxyConfig) *mux.Router
- func CleanUp()
- func CleanUpSocket()
- func GetActiveProxies() []string
- func GetClientID(r *http.Request, route utils.ProxyRouteConfig) string
- func GetShield() int
- func IPInRange(ip, cidr string) (bool, error)
- func InitInternalSocketProxy()
- func InitSocketShield()
- func InitUDPShield()
- func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool, DisableHeaderHardening bool, ...) (*httputil.ReverseProxy, error)
- func PublishAllMDNSFromConfig()
- func RestartMDNS()
- func RouteTo(route utils.ProxyRouteConfig) http.Handler
- func RouterGen(route utils.ProxyRouteConfig, router *mux.Router, destination http.Handler) *mux.Route
- func SmartShieldMiddleware(shieldID string, route utils.ProxyRouteConfig) func(http.Handler) http.Handler
- func StartBudgetEnforcer()
- func StopAllProxies()
- func TCPSmartShieldMiddleware(shieldID string, route utils.ProxyRouteConfig) func(net.Conn) net.Conn
- func UDPSmartShieldMiddleware(shieldID string, route utils.ProxyRouteConfig) func([]byte, net.Addr) []byte
- type GlobalSmartShieldState
- type PortsPair
- type ProxyInfo
- type Publisher
- 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)
- type TCPConnectionWrapper
- func (w *TCPConnectionWrapper) Close() error
- func (w *TCPConnectionWrapper) LocalAddr() net.Addr
- func (w *TCPConnectionWrapper) Read(b []byte) (int, error)
- func (w *TCPConnectionWrapper) RemoteAddr() net.Addr
- func (w *TCPConnectionWrapper) SetDeadline(t time.Time) error
- func (w *TCPConnectionWrapper) SetReadDeadline(t time.Time) error
- func (w *TCPConnectionWrapper) SetWriteDeadline(t time.Time) error
- func (w *TCPConnectionWrapper) Write(b []byte) (int, error)
- type TCPSmartShieldState
- func (shield *TCPSmartShieldState) EnforceBudget()
- func (shield *TCPSmartShieldState) GetServerConnections(shieldID string) int
- func (shield *TCPSmartShieldState) GetUserUsedBudgets(shieldID string, clientID string) TCPUserUsedBudget
- func (shield *TCPSmartShieldState) IsAllowedToConnect(shieldID string, policy utils.SmartShieldPolicy, ...) bool
- type TCPUserUsedBudget
- type UDPConnectionInfo
- type UDPSmartShieldState
- type UserBan
Constants ¶
View Source
const ( AVAHI_DNS_CLASS_IN = uint16(0x01) AVAHI_DNS_TYPE_CNAME = uint16(0x05) )
View Source
const ( STRIKE = 0 TEMP = 1 PERM = 2 )
Variables ¶
This section is empty.
Functions ¶
func AddConstellationToken ¶ added in v0.16.0
func BotDetectionMiddleware ¶
botDetectionMiddleware checks if the User-Agent is a known bot
func BuildFromConfig ¶
func CleanUpSocket ¶ added in v0.17.0
func CleanUpSocket()
func GetActiveProxies ¶ added in v0.15.0
func GetActiveProxies() []string
func GetClientID ¶
func GetClientID(r *http.Request, route utils.ProxyRouteConfig) string
func InitInternalSocketProxy ¶ added in v0.17.0
func InitInternalSocketProxy()
func InitSocketShield ¶ added in v0.17.0
func InitSocketShield()
func InitUDPShield ¶ added in v0.17.0
func InitUDPShield()
func NewProxy ¶
func NewProxy(targetHost string, AcceptInsecureHTTPSTarget bool, DisableHeaderHardening bool, route utils.ProxyRouteConfig) (*httputil.ReverseProxy, error)
NewProxy takes target host and creates a reverse proxy
func PublishAllMDNSFromConfig ¶ added in v0.16.0
func PublishAllMDNSFromConfig()
func RestartMDNS ¶ added in v0.16.3
func RestartMDNS()
func SmartShieldMiddleware ¶
func StartBudgetEnforcer ¶ added in v0.17.0
func StartBudgetEnforcer()
func StopAllProxies ¶ added in v0.17.0
func StopAllProxies()
func TCPSmartShieldMiddleware ¶ added in v0.17.0
func UDPSmartShieldMiddleware ¶ added in v0.17.0
Types ¶
type GlobalSmartShieldState ¶ added in v0.17.0
type ProxyInfo ¶ added in v0.17.0
type ProxyInfo struct {
// contains filtered or unexported fields
}
type Publisher ¶ added in v0.16.0
type Publisher struct {
// contains filtered or unexported fields
}
func NewPublisher ¶ added in v0.16.0
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)
type TCPConnectionWrapper ¶ added in v0.17.0
type TCPConnectionWrapper struct { Conn net.Conn TimeStarted time.Time TimeEnded time.Time ClientID string Packets int64 Bytes int64 IsOver bool ShieldID string Policy utils.SmartShieldPolicy IsPrivileged bool ThrottleUntil time.Duration Route utils.ProxyRouteConfig // contains filtered or unexported fields }
func TCPSmartShieldWrapper ¶ added in v0.17.0
func TCPSmartShieldWrapper(conn net.Conn, shieldID string, route utils.ProxyRouteConfig, policy utils.SmartShieldPolicy) *TCPConnectionWrapper
func (*TCPConnectionWrapper) Close ¶ added in v0.17.0
func (w *TCPConnectionWrapper) Close() error
func (*TCPConnectionWrapper) LocalAddr ¶ added in v0.17.0
func (w *TCPConnectionWrapper) LocalAddr() net.Addr
Implement the missing methods to satisfy the net.Conn interface
func (*TCPConnectionWrapper) Read ¶ added in v0.17.0
func (w *TCPConnectionWrapper) Read(b []byte) (int, error)
func (*TCPConnectionWrapper) RemoteAddr ¶ added in v0.17.0
func (w *TCPConnectionWrapper) RemoteAddr() net.Addr
func (*TCPConnectionWrapper) SetDeadline ¶ added in v0.17.0
func (w *TCPConnectionWrapper) SetDeadline(t time.Time) error
func (*TCPConnectionWrapper) SetReadDeadline ¶ added in v0.17.0
func (w *TCPConnectionWrapper) SetReadDeadline(t time.Time) error
func (*TCPConnectionWrapper) SetWriteDeadline ¶ added in v0.17.0
func (w *TCPConnectionWrapper) SetWriteDeadline(t time.Time) error
type TCPSmartShieldState ¶ added in v0.17.0
type TCPSmartShieldState struct { sync.Mutex Connections []*TCPConnectionWrapper Bans []*UserBan }
func (*TCPSmartShieldState) EnforceBudget ¶ added in v0.17.0
func (shield *TCPSmartShieldState) EnforceBudget()
func (*TCPSmartShieldState) GetServerConnections ¶ added in v0.17.0
func (shield *TCPSmartShieldState) GetServerConnections(shieldID string) int
func (*TCPSmartShieldState) GetUserUsedBudgets ¶ added in v0.17.0
func (shield *TCPSmartShieldState) GetUserUsedBudgets(shieldID string, clientID string) TCPUserUsedBudget
func (*TCPSmartShieldState) IsAllowedToConnect ¶ added in v0.17.0
func (shield *TCPSmartShieldState) IsAllowedToConnect(shieldID string, policy utils.SmartShieldPolicy, userConsumed TCPUserUsedBudget) bool
type TCPUserUsedBudget ¶ added in v0.17.0
type UDPConnectionInfo ¶ added in v0.17.0
type UDPSmartShieldState ¶ added in v0.17.0
type UDPSmartShieldState struct { sync.Mutex Connections map[string]*UDPConnectionInfo }
Click to show internal directories.
Click to hide internal directories.