Documentation ¶
Index ¶
- type Auth
- type Context
- func (ctx *Context) APIRequest()
- func (ctx *Context) Get(key string) (interface{}, bool)
- func (ctx *Context) ID() string
- func (ctx *Context) IsAPIRequest() bool
- func (ctx *Context) Session() *Session
- func (ctx *Context) Set(key string, val interface{})
- func (ctx *Context) SkipLogging()
- func (ctx *Context) SkipRoundTrip()
- func (ctx *Context) SkippingLogging() bool
- func (ctx *Context) SkippingRoundTrip() bool
- type Proxy
- func (p *Proxy) AllowTlsUrls(urls []string)
- func (p *Proxy) Close()
- func (p *Proxy) Closing() bool
- func (p *Proxy) GetAllowTlsUrls() []string
- func (p *Proxy) GetRoundTripper() http.RoundTripper
- func (p *Proxy) Serve(l net.Listener) error
- func (p *Proxy) SetDial(dial func(string, string) (net.Conn, error))
- func (p *Proxy) SetDownstreamProxy(proxyURL *url.URL)
- func (p *Proxy) SetMITM(config *mitm.Config)
- func (p *Proxy) SetRoundTripper(rt http.RoundTripper)
- func (p *Proxy) SetTimeout(timeout time.Duration)
- func (p *Proxy) StartSocks5(httpAddr, socks5Addr string)
- func (p *Proxy) Use(handlers ...middlewares.Middleware)
- type Session
- func (s *Session) Get(key string) (interface{}, bool)
- func (s *Session) Hijack() (net.Conn, *bufio.ReadWriter, error)
- func (s *Session) Hijacked() bool
- func (s *Session) ID() string
- func (s *Session) IsSecure() bool
- func (s *Session) MarkInsecure()
- func (s *Session) MarkSecure()
- func (s *Session) Set(key string, val interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context provides information and storage for a single request/response pair. Contexts are linked to shared session that is used for multiple requests on a single connection.
func NewContext ¶
NewContext returns a context for the in-flight HTTP request.
func (*Context) APIRequest ¶
func (ctx *Context) APIRequest()
APIRequest marks the requests as a request to the proxy API.
func (*Context) IsAPIRequest ¶
IsAPIRequest returns true when the request patterns matches a pattern in the proxy mux. The mux is usually defined as a parameter to the api.Forwarder, which uses http.DefaultServeMux by default.
func (*Context) Set ¶
Set takes a key and associates it with val in the context. The value is persisted for the duration of the request and is removed on the following request.
func (*Context) SkipLogging ¶
func (ctx *Context) SkipLogging()
SkipLogging skips logging by gomitmproxy loggers for the current request.
func (*Context) SkipRoundTrip ¶
func (ctx *Context) SkipRoundTrip()
SkipRoundTrip skips the round trip for the current request.
func (*Context) SkippingLogging ¶
SkippingLogging returns whether the current request / response pair will be logged.
func (*Context) SkippingRoundTrip ¶
SkippingRoundTrip returns whether the current round trip will be skipped.
type Proxy ¶
type Proxy struct { *Auth // contains filtered or unexported fields }
func (*Proxy) AllowTlsUrls ¶
func (*Proxy) GetAllowTlsUrls ¶
func (*Proxy) GetRoundTripper ¶
func (p *Proxy) GetRoundTripper() http.RoundTripper
func (*Proxy) SetDownstreamProxy ¶
func (*Proxy) SetRoundTripper ¶
func (p *Proxy) SetRoundTripper(rt http.RoundTripper)
func (*Proxy) SetTimeout ¶
func (*Proxy) StartSocks5 ¶
func (*Proxy) Use ¶
func (p *Proxy) Use(handlers ...middlewares.Middleware)
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
Session provides information and storage about a connection.
func (*Session) Hijack ¶
Hijack takes control of the connection from the proxy. No further action will be taken by the proxy and the connection will be closed following the return of the hijacker.
func (*Session) IsSecure ¶
IsSecure returns whether the current session is from a secure connection, such as when receiving requests from a TLS connection that has been MITM'd.
func (*Session) MarkInsecure ¶
func (s *Session) MarkInsecure()
MarkInsecure marks the session as insecure.