Documentation ¶
Overview ¶
Package proxyutil contains different utility methods that will be helpful to gomitmproxy users.
Index ¶
- func DecodeLatin1(reader io.Reader) (str string, err error)
- func EncodeLatin1(str string) ([]byte, error)
- func NewErrorResponse(req *http.Request, err error) (resp *http.Response)
- func NewResponse(code int, body io.Reader, req *http.Request) (resp *http.Response)
- func ReadDecompressedBody(res *http.Response) (b []byte, err error)
- type NoopConn
- func (NoopConn) Close() error
- func (NoopConn) LocalAddr() net.Addr
- func (NoopConn) Read(b []byte) (int, error)
- func (NoopConn) RemoteAddr() net.Addr
- func (NoopConn) SetDeadline(time.Time) error
- func (NoopConn) SetReadDeadline(time.Time) error
- func (NoopConn) SetWriteDeadline(time.Time) error
- func (NoopConn) Write(b []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeLatin1 ¶
DecodeLatin1 decodes Latin1 string from the reader. This method is useful for editing response bodies when you don't want to handle different encodings.
func EncodeLatin1 ¶
EncodeLatin1 encodes the string as a byte array using Latin1.
func NewErrorResponse ¶
NewErrorResponse creates a new HTTP response with status code "502 Bad Gateway". "Warning" header is populated with the error details. See https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Warning.
func NewResponse ¶
NewResponse builds a new HTTP response. If body is nil, an empty byte.Buffer will be provided to be consistent with the guarantees provided by http.Transport and http.Client.
Types ¶
type NoopConn ¶
type NoopConn struct{}
NoopConn is a struct that implements net.Conn and does nothing.
func (NoopConn) RemoteAddr ¶
RemoteAddr always returns 0.0.0.0:0.
func (NoopConn) SetDeadline ¶
SetDeadline does nothing, returns nil.
func (NoopConn) SetReadDeadline ¶
SetReadDeadline does nothing, returns nil.
func (NoopConn) SetWriteDeadline ¶
SetWriteDeadline does nothing, returns nil.