Versions in this module Expand all Collapse all v1 v1.0.5 Feb 15, 2019 Changes in this version + const DONE + const FORWARD + const MITM + const MOCK + const NEXT + const REJECT + const SIGNATURE + var AlwaysForward = HandlerFunc(func(ctx *ProxyCtx) Next { ... }) + var AlwaysMitm = HandlerFunc(func(ctx *ProxyCtx) Next { ... }) + var AlwaysReject = HandlerFunc(func(ctx *ProxyCtx) Next { ... }) + var CA_CERT = []byte(...) + var CA_KEY = []byte(...) + var MaxSerialNumber = big.NewInt(0).SetBytes(bytes.Repeat([]byte{ ... }, 20)) + var NonHTTPRequest = "nonhttprequest" + var OrganizationName = "Winston Privacy, Inc." + func CondRemoteAddrIs(ctx *ProxyCtx, ip string) bool + func GenerateSignature(h *vhost.ClientHelloMsg, debug bool) string + func GetSubdomains(domain string) []string + func HijackedDNSDialer() *net.Dialer + func HostsToMap(hosts ...string) map[string]bool + func IsExternal(hostname string) bool + func LoadDefaultConfig() error + func MatchIsLocalhost(req *http.Request) bool + func MatchRequestHostMap(req *http.Request, hosts map[string]bool) bool + func NewResponse(r *http.Request, status int, contentType, body string) *http.Response + func WhitelistedDNSDialer() *net.Dialer + type ChainedHandler func(Handler) Handler + func RemoteAddrIs(ip string) ChainedHandler + func RemoteAddrIsNot(ip string) ChainedHandler + func ReqHostMatches(regexps ...*regexp.Regexp) ChainedHandler + func RequestHostContains(hosts ...string) ChainedHandler + func RequestHostIsIn(hosts ...string) ChainedHandler + func RequestHostIsNotIn(hosts ...string) ChainedHandler + func RespContentTypeIs(types ...string) ChainedHandler + func UrlHasPrefix(prefix string) ChainedHandler + func UrlIsIn(urls ...string) ChainedHandler + func UrlMatches(re *regexp.Regexp) ChainedHandler + type CounterEncryptorRand struct + func NewCounterEncryptorRandFromKey(key interface{}, seed []byte) (r CounterEncryptorRand, err error) + func (c *CounterEncryptorRand) Read(b []byte) (n int, err error) + func (c *CounterEncryptorRand) Seed(b []byte) + type GoproxyConfigServer struct + Host map[string]*HostInfo + IsExternal func(string) bool + Root *x509.Certificate + RootCAs *x509.CertPool + var GoproxyCaConfig *GoproxyConfigServer + func LoadCAConfig(filename string, caCert, caKey []byte) (*GoproxyConfigServer, error) + func NewConfigServer(filename string, ca *x509.Certificate, privateKey interface{}) (*GoproxyConfigServer, error) + func (c *GoproxyConfigServer) Cert(hostname string) (*tls.Config, error) + func (c *GoproxyConfigServer) FlushCert(hostname string) + func (c *GoproxyConfigServer) GetTestCertificate(host string, port string) (*tls.Config, error) + type Handler interface + Handle func(ctx *ProxyCtx) Next + func IsLocalhost(chainedHandler Handler) Handler + func IsNotLocalhost(chainedHandler Handler) Handler + type HandlerFunc func(ctx *ProxyCtx) Next + func (f HandlerFunc) Handle(ctx *ProxyCtx) Next + type HostInfo struct + Config *tls.Config + LastVerify time.Time + NextAttempt time.Time + type IdleTimeoutConn struct + Conn net.Conn + Deadline time.Time + IdleTimeout int + func (idleconn *IdleTimeoutConn) Close() error + func (idleconn *IdleTimeoutConn) LocalAddr() net.Addr + func (idleconn *IdleTimeoutConn) Read(buf []byte) (int, error) + func (idleconn *IdleTimeoutConn) RemoteAddr() net.Addr + func (idleconn *IdleTimeoutConn) SetDeadline(t time.Time) error + func (idleconn *IdleTimeoutConn) SetReadDeadline(t time.Time) error + func (idleconn *IdleTimeoutConn) SetWriteDeadline(t time.Time) error + func (idleconn *IdleTimeoutConn) Write(buf []byte) (int, error) + type Next int + type NonHTTPRoundTripper struct + DialContext func(ctx context.Context, network string, addr string) (net.Conn, error) + ExpectContinueTimeout time.Duration + MaxResponseHeaderBytes int64 + ResponseHeaderTimeout time.Duration + TLSClientConfig *tls.Config + TLSHandshakeTimeout time.Duration + func (t *NonHTTPRoundTripper) CancelRequest(req *http.Request) + func (tr *NonHTTPRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) + type ProxyCtx struct + CipherSignature string + Conn net.Conn + CookiesModified int + DeviceType int + ElementsModified int + Error error + FirstParty bool + IgnoreCounter bool + IsNonHttpProtocol bool + IsSecure bool + IsThroughMITM bool + IsThroughTunnel bool + MITMCertConfig *GoproxyConfigServer + Method string + NewBodyLength int + NonHTTPRequest []byte + OriginalRequest *http.Request + PrivateNetwork bool + Proxy *ProxyHttpServer + Referrer string + Req *http.Request + RequestTime time.Time + Resp *http.Response + ResponseError error + ResponseWriter http.ResponseWriter + RevealTimeRemaining int + RoundTripper RoundTripper + Session int64 + ShadowTransport *shadownetwork.ShadowTransport + SkipRequestHandler bool + SkipResponseHandler bool + SourceIP string + StatusMessage []string + TimeRemaining int + Tlsfailure func(ctx *ProxyCtx, untrustedCertificate bool) + Trace traceRequest + TraceInfo *TraceInfo + UserData map[string]string + UserObjects map[string]interface{} + VerbosityLevel uint16 + Whitelisted bool + func (ctx *ProxyCtx) BufferResponse() ([]byte, error) + func (ctx *ProxyCtx) Charset() string + func (ctx *ProxyCtx) DispatchDoneHandlers() error + func (ctx *ProxyCtx) DispatchResponseHandlers() error + func (ctx *ProxyCtx) FakeDestinationDNS(host string) + func (ctx *ProxyCtx) FlushHARToDisk(filename string) + func (ctx *ProxyCtx) ForwardConnect() error + func (ctx *ProxyCtx) ForwardNonHTTPRequest(host string) error + func (ctx *ProxyCtx) ForwardRequest(host string) error + func (ctx *ProxyCtx) ForwardResponse(resp *http.Response) error + func (ctx *ProxyCtx) HijackConnect() net.Conn + func (ctx *ProxyCtx) Host() string + func (ctx *ProxyCtx) LogToHARFile(captureContent bool) Next + func (ctx *ProxyCtx) Logf(level uint16, msg string, argv ...interface{}) + func (ctx *ProxyCtx) ManInTheMiddle() error + func (ctx *ProxyCtx) ManInTheMiddleHTTPS() error + func (ctx *ProxyCtx) NewEmptyGif() + func (ctx *ProxyCtx) NewEmptyImage(extension string) + func (ctx *ProxyCtx) NewEmptyPng() + func (ctx *ProxyCtx) NewEmptyScript() + func (ctx *ProxyCtx) NewHTMLResponse(body string) + func (ctx *ProxyCtx) NewResponse(status int, contentType, body string) + func (ctx *ProxyCtx) NewTextResponse(body string) + func (ctx *ProxyCtx) RecordStatus(msg string) + func (ctx *ProxyCtx) RejectConnect() + func (ctx *ProxyCtx) RoundTrip(req *http.Request) (*http.Response, error) + func (ctx *ProxyCtx) SNIHost() string + func (ctx *ProxyCtx) SetConnectScheme(scheme string) + func (ctx *ProxyCtx) SetDestinationHost(host string) + func (ctx *ProxyCtx) SetRequestBody(req *http.Request, body io.Reader) error + func (ctx *ProxyCtx) SetResponseBody(content []byte) + func (ctx *ProxyCtx) TunnelHTTP() error + func (ctx *ProxyCtx) Warnf(msg string, argv ...interface{}) + type ProxyHttpServer struct + ConnectDial func(network string, addr string) (net.Conn, error) + ConnectDialContext func(ctx context.Context, network string, addr string) (net.Conn, error) + FlushIdleConnections bool + HandleHTTP func(ctx *ProxyCtx) bool + Logger *log.Logger + MITMCertConfig *GoproxyConfigServer + NonHTTPRoundTripper *NonHTTPRoundTripper + NonProxyHandler http.Handler + PrivateNetwork *shadownetwork.ShadowNetwork + SniffSNI bool + Tlsfailure func(ctx *ProxyCtx, untrustedCertificate bool) + Trace func(ctx *ProxyCtx) traceRequest + Transport *http.Transport + UpdateAllowedCounter func(string, string, string, int, int, int) + UpdateBlockedCounter func(string, string, string, int, bool) + UpdateWhitelistedCounter func(string, string, string, int) + Verbose bool + VerbosityLevel uint16 + func NewProxyHttpServer() *ProxyHttpServer + func (proxy *ProxyHttpServer) BufferLogEntry(signature, entry string) + func (proxy *ProxyHttpServer) DispatchRequestHandlers(ctx *ProxyCtx) + func (proxy *ProxyHttpServer) FlushHARToDisk(filename string) + func (proxy *ProxyHttpServer) GetLogEntries(signature string) []string + func (proxy *ProxyHttpServer) HandleConnect(f Handler) + func (proxy *ProxyHttpServer) HandleConnectFunc(f func(ctx *ProxyCtx) Next) + func (proxy *ProxyHttpServer) HandleDone(f Handler) + func (proxy *ProxyHttpServer) HandleDoneFunc(f func(ctx *ProxyCtx) Next) + func (proxy *ProxyHttpServer) HandleRequest(f Handler) + func (proxy *ProxyHttpServer) HandleRequestFunc(f func(ctx *ProxyCtx) Next) + func (proxy *ProxyHttpServer) HandleResponse(f Handler) + func (proxy *ProxyHttpServer) HandleResponseFunc(f func(ctx *ProxyCtx) Next) + func (proxy *ProxyHttpServer) LastSignature() string + func (proxy *ProxyHttpServer) ListenAndServe(addr string) error + func (proxy *ProxyHttpServer) ListenAndServeTLS(httpsAddr string) error + func (proxy *ProxyHttpServer) Logf(level uint16, msg string, v ...interface{}) + func (proxy *ProxyHttpServer) NewConnectDialToProxy(https_proxy string) func(network, addr string) (net.Conn, error) + func (proxy *ProxyHttpServer) NewConnectDialToProxyContext(https_proxy string) func(ctx context.Context, network, addr string) (net.Conn, error) + func (proxy *ProxyHttpServer) ServeHTTP(w http.ResponseWriter, r *http.Request) + func (proxy *ProxyHttpServer) SetMITMCertConfig(config *GoproxyConfigServer) + func (proxy *ProxyHttpServer) SetShadowNetwork(sn *shadownetwork.ShadowNetwork) + func (proxy *ProxyHttpServer) SetSignature(signature string) + func (proxy *ProxyHttpServer) TestConnectDialContext(ctx context.Context, network, addr string) (c net.Conn, err error) + type RequestTracer struct + Requests []traceRequest + func (tr *RequestTracer) RequestTrace(cmd []string, seconds int) + func (tr *RequestTracer) Trace(ctx *ProxyCtx) traceRequest + type RoundTripper interface + RoundTrip func(req *http.Request, ctx *ProxyCtx) (*http.Response, error) + type RoundTripperFunc func(req *http.Request, ctx *ProxyCtx) (*http.Response, error) + func (f RoundTripperFunc) RoundTrip(req *http.Request, ctx *ProxyCtx) (*http.Response, error) + type SpyConnection struct + func (sc *SpyConnection) Read(b []byte) (int, error) + func (sc *SpyConnection) Write(b []byte) (int, error) + type TraceInfo struct + CookiesReceived []string + CookiesSent []string + MITM bool + Method *string + Name string + PrivateNetwork bool + ReqBody *[]byte + RequestDuration time.Duration + RequestHeaders []string + RequestTime time.Time + ResponseHeaders []string + RoundTripError string + StatusCode int