proxy

package
v0.0.0-rc13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckRequestContains

func CheckRequestContains(in []RequestResponse, expectedString string) bool

Types

type HTTPProxy

type HTTPProxy struct {
	ListenPort int

	WithLogger bool

	Err error
	// contains filtered or unexported fields
}

func NewHTTPProxy

func NewHTTPProxy(listenPort int, targetAddr string) *HTTPProxy

func NewHTTPProxyWithPortAllocation

func NewHTTPProxyWithPortAllocation(targetAddr string) *HTTPProxy

func NewHTTPSProxy

func NewHTTPSProxy(listenPort int, targetAddr, pathToPem, pathToKey string) *HTTPProxy

func NewHTTPSProxyWithPortAllocation

func NewHTTPSProxyWithPortAllocation(targetAddr, pathToPem, pathToKey string) *HTTPProxy

func (*HTTPProxy) GetSniffedData

func (p *HTTPProxy) GetSniffedData() []RequestResponse

func (*HTTPProxy) ResetSniffedData

func (p *HTTPProxy) ResetSniffedData()

func (*HTTPProxy) RunAsync

func (p *HTTPProxy) RunAsync() *Worker

type RequestResponse

type RequestResponse struct {
	ReqMethod string
	ReqURL    string
	ReqBody   []byte
	RespBody  []byte
}

func NewRequestResponse

func NewRequestResponse(reqMethod string, reqURL string, srcHeader http.Header, reqBody []byte, respHeader http.Header, respBody []byte) *RequestResponse

func (*RequestResponse) Print

func (r *RequestResponse) Print()

type Worker

type Worker struct {
	// contains filtered or unexported fields
}

func WorkerFromListener

func WorkerFromListener(listener net.Listener) *Worker

func WorkerFromServer

func WorkerFromServer(server *http.Server) *Worker

func (*Worker) Close

func (w *Worker) Close() error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL