httpproxy

package
v0.0.0-...-109c5d9 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2021 License: Apache-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseURL

func BaseURL(gw *net.UDPAddr) string

Types

type HTTPGate

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

HTTPGate handles HTTP requests

func NewHTTPGate

func NewHTTPGate(gw *mesh.Gateway, h2 *h2.H2) *HTTPGate

func (*HTTPGate) DMNodeHttpRequestViaNeighbor

func (gw *HTTPGate) DMNodeHttpRequestViaNeighbor(or *http.Request, w http.ResponseWriter,
	oldPath, oldPathIp string,
	neighborLocalAddr *net.UDPAddr, path string) error

ReverseForward the request to a DMESH host, using a neighbor address.

path is either a URL on the destination host or a forward.

func (*HTTPGate) ForwardHTTP

func (gw *HTTPGate) ForwardHTTP(w http.ResponseWriter, r *http.Request, pathH string)

ReverseForward a request to a normal HTTP host. Used if the Host header found is configured explicitly to forward to a specific address.

func (*HTTPGate) HttpForwardPath

func (gw *HTTPGate) HttpForwardPath(w http.ResponseWriter, r *http.Request)

Mapped to /dm/[NODEID]/[NODEID]/HOST:PORT]/c/[REALPATH]. ReverseForward a GET via a full path. Will use the H2 ports of the node. This was used for debugging.

Mapped to /dm/[NODEID]/[NODEID]/HOST:PORT]/d/[REALPATH]. Will create a direct path (circuit) using the nodes. Exit node will initiate a HTTP(s) connection

Exposed only on the loopback interface.

func (*HTTPGate) HttpForwardPath2

func (gw *HTTPGate) HttpForwardPath2(w http.ResponseWriter, r *http.Request)

func (*HTTPGate) HttpProxyCapture

func (gw *HTTPGate) HttpProxyCapture(addr string) error

Start listening on the addr, as a HTTP_PROXY Handles CONNECT and PROXY requests using the gateway for streams.

func (*HTTPGate) ProxyHttp

func (gw *HTTPGate) ProxyHttp(cl *http.Client, or *http.Request, w http.ResponseWriter, nurl, oldPath string) error

Jump to

Keyboard shortcuts

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