Versions in this module Expand all Collapse all v0 v0.1.0 Aug 2, 2023 Changes in this version + type Addon interface + ClientConnected func(*ClientConn) + ClientDisconnected func(*ClientConn) + Request func(*Flow) + Requestheaders func(*Flow) + Response func(*Flow) + Responseheaders func(*Flow) + ServerConnected func(*ConnContext) + ServerDisconnected func(*ConnContext) + StreamRequestModifier func(*Flow, io.Reader) io.Reader + StreamResponseModifier func(*Flow, io.Reader) io.Reader + TlsEstablishedServer func(*ConnContext) + type BaseAddon struct + func (addon *BaseAddon) ClientConnected(*ClientConn) + func (addon *BaseAddon) ClientDisconnected(*ClientConn) + func (addon *BaseAddon) Request(*Flow) + func (addon *BaseAddon) Requestheaders(*Flow) + func (addon *BaseAddon) Response(*Flow) + func (addon *BaseAddon) Responseheaders(*Flow) + func (addon *BaseAddon) ServerConnected(*ConnContext) + func (addon *BaseAddon) ServerDisconnected(*ConnContext) + func (addon *BaseAddon) StreamRequestModifier(f *Flow, in io.Reader) io.Reader + func (addon *BaseAddon) StreamResponseModifier(f *Flow, in io.Reader) io.Reader + func (addon *BaseAddon) TlsEstablishedServer(*ConnContext) + type ClientConn struct + Conn *wrapClientConn + ID uuid.UUID + TLS bool + func (c *ClientConn) MarshalJSON() ([]byte, error) + type ConnContext struct + ClientConn *ClientConn + ServerConn *ServerConn + func (connCtx *ConnContext) ID() uuid.UUID + type Flow struct + ConnContext *ConnContext + Id uuid.UUID + Request *Request + Response *Response + Stream bool + func (f *Flow) Done() <-chan struct{} + func (f *Flow) MarshalJSON() ([]byte, error) + type Options struct + Addr string + CA cert.Getter + Debug int + InsecureSkipVerifyTLS bool + StreamLargeBodies int64 + type Proxy struct + Addons []Addon + Opts *Options + Version string + func NewProxy(opts *Options) (*Proxy, error) + func (proxy *Proxy) AddAddon(addon Addon) + func (proxy *Proxy) Close() error + func (proxy *Proxy) ServeHTTP(res http.ResponseWriter, req *http.Request) + func (proxy *Proxy) Shutdown(ctx context.Context) error + func (proxy *Proxy) Start() error + type Request struct + Body []byte + Header http.Header + Method string + Proto string + URL *url.URL + func (r *Request) Raw() *http.Request + func (r *Request) WithAttribute(key string, val any) + func (req *Request) MarshalJSON() ([]byte, error) + func (req *Request) UnmarshalJSON(data []byte) error + type Response struct + Body []byte + BodyReader io.Reader + Header http.Header + StatusCode int + func (r *Response) DecodedBody() ([]byte, error) + func (r *Response) IsTextContentType() bool + func (r *Response) ReplaceToDecodedBody() + type ServerConn struct + Address string + Conn net.Conn + ID uuid.UUID + func (c *ServerConn) MarshalJSON() ([]byte, error) + func (c *ServerConn) TLSState() *tls.ConnectionState