Documentation ¶
Overview ¶
* * Copyright (c) 2020 Ameya Lokare
* * Copyright (c) 2020 Ameya Lokare
*
- Copyright (c) 2020 Ameya Lokare
Index ¶
- Constants
- func CreateProxyServers(proxyConfig *ProxyConfig) []*http.Server
- func InitConfig(config *ProxyConfig) error
- func PublicKey(priv interface{}) interface{}
- func SetupLogging(config *ProxyConfig) error
- func SetupMetrics(metricsAddress string)
- func StartHTTPServer(listenAddress string, server *http.Server, wg *sync.WaitGroup)
- func StartTLSServer(listenAddress, certFile, keyFile string, server *http.Server, ...)
- type AccessLogTextFormatter
- type Cidr
- type ListenerConfig
- type LogConfig
- type LogType
- type Mitmer
- type Protocol
- type ProxyConfig
- type ProxyHTTPHandler
- type ProxyLogTextFormatter
Constants ¶
View Source
const ( ReasonCodeHeader string = "X-WhSentry-ReasonCode" ReasonHeader string = "X-WhSentry-Reason" BlockedIPAddress uint16 = 1000 UnableToResolveIP uint16 = 1001 InvalidRequestURI uint16 = 1002 InvalidUrlScheme uint16 = 1003 RequestTimedOut uint16 = 1004 TLSHandshakeError uint16 = 1005 TCPConnectionError uint16 = 1006 CertificateValidationError uint16 = 1007 ResponseTooLarge uint16 = 1008 InternalServerError uint16 = 1009 ClientCertNotFoundError uint16 = 1010 )
Variables ¶
This section is empty.
Functions ¶
func CreateProxyServers ¶
func CreateProxyServers(proxyConfig *ProxyConfig) []*http.Server
func InitConfig ¶
func InitConfig(config *ProxyConfig) error
func SetupLogging ¶
func SetupLogging(config *ProxyConfig) error
func SetupMetrics ¶
func SetupMetrics(metricsAddress string)
func StartHTTPServer ¶
Types ¶
type AccessLogTextFormatter ¶
type AccessLogTextFormatter struct { }
type Cidr ¶
func (*Cidr) UnmarshalYAML ¶
type ListenerConfig ¶
type Mitmer ¶
type Mitmer struct {
// contains filtered or unexported fields
}
func (*Mitmer) HandleHttpConnect ¶
type ProxyConfig ¶
type ProxyConfig struct { CidrDenyList []Cidr `yaml:"cidrDenyList"` Listeners []ListenerConfig `yaml:"listeners"` ConnectTimeout time.Duration `yaml:"connectTimeout"` ConnectionLifetime time.Duration `yaml:"connectionLifetime"` ReadTimeout time.Duration `yaml:"readTimeout"` MaxResponseBodySize uint32 `yaml:"maxResponseBodySize"` InsecureSkipCertVerification bool `yaml:"insecureSkipCertVerification"` InsecureSkipCidrDenyList bool `yaml:"insecureSkipCidrDenyList"` ClientCertFile string `yaml:"clientCertFile"` ClientKeyFile string `yaml:"clientKeyFile"` ClientCerts map[string]tls.Certificate `yaml:"-"` RootCACerts *x509.CertPool `yaml:"-"` // TODO: not taking a file override yet MitmIssuerCertFile string `yaml:"mitmIssuerCertFile"` MitmIssuerKeyFile string `yaml:"mitmIssuerKeyFile"` MitmIssuerCert *tls.Certificate `yaml:"-"` AccessLog LogConfig `yaml:"accessLog"` ProxyLog LogConfig `yaml:"proxyLog"` MetricsAddress string `yaml:"metricsAddress"` RequestIDHeader string `yaml:"requestIDHeader"` }
func InitDefaultConfig ¶
func InitDefaultConfig() (*ProxyConfig, error)
func NewDefaultConfig ¶
func NewDefaultConfig() *ProxyConfig
func UnmarshalConfig ¶
func UnmarshalConfig(configData []byte) (*ProxyConfig, error)
func UnmarshalConfigFromFile ¶
func UnmarshalConfigFromFile(configFile string) (*ProxyConfig, error)
func (*ProxyConfig) Validate ¶ added in v1.1.0
func (config *ProxyConfig) Validate() error
type ProxyHTTPHandler ¶
type ProxyHTTPHandler struct {
// contains filtered or unexported fields
}
ProxyHTTPHandler some struct
func (*ProxyHTTPHandler) ServeHTTP ¶
func (p *ProxyHTTPHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ProxyLogTextFormatter ¶
type ProxyLogTextFormatter struct { }
Click to show internal directories.
Click to hide internal directories.