proxy

package
v0.0.0-...-99214e8 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProxyHasBennStarted = errors.New("Proxy server has been started.")

Functions

func Address

func Address() string

func DoRequest

func DoRequest(req *http.Request, body []byte)

func DoResponse

func DoResponse(resp *http.Response, body []byte)

func IsEnabled

func IsEnabled() bool

IsEnabled returns the proxy status.

func LoadModule

func LoadModule(ctx context.Context, id string) error

LoadModule loads module with the given ID.

func ReloadAllModules

func ReloadAllModules(ctx context.Context) error

ReloadAllModules loads all modules.

func Shutdown

func Shutdown() error

Shutdown shuts down the proxy server. It returns ErrProxyHasBennStarted if the server has already been shut down.

func Start

func Start(addr string) error

Start starts the proxy. If the proxy has already been started, it will do nothing.

Types

type Proxy

type Proxy struct {
	http.Server
	// contains filtered or unexported fields
}

Proxy is the MitM server which supports start and shutdown.

func SetDefaultProxy

func SetDefaultProxy() (*Proxy, error)

SetDefaultProxy initializes the proxy and returns the proxy instance.

func (*Proxy) SetCA

func (p *Proxy) SetCA(caCert, caKey []byte) error

SetCA sets the goproxy server certificate globally.

Jump to

Keyboard shortcuts

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