http

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: BSD-3-Clause Imports: 9 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHTTP

func NewHTTP(listenAddr string) proxy.Proxy

NewHTTP creates a new proxy http

Types

type HTTP

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

HTTP defines a proxy http

- implements proxy.Proxy

func (HTTP) GetAddr

func (h HTTP) GetAddr() net.Addr

GetAddr implements proxy.Proxy.

func (*HTTP) Listen

func (h *HTTP) Listen()

Listen implements proxy.Proxy. This function can be called multiple times provided the server is not running, ie. Stop() has been called.

func (HTTP) RegisterHandler

func (h HTTP) RegisterHandler(path string, handler func(http.ResponseWriter,
	*http.Request))

RegisterHandler implements proxy.Proxy

func (HTTP) Stop

func (h HTTP) Stop()

Stop implements proxy.Proxy. It should be called only once in order to make a new Listen() successful.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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