Documentation ¶
Index ¶
- func BaseURL(gw *net.UDPAddr) string
- type HTTPGate
- func (gw *HTTPGate) DMNodeHttpRequestViaNeighbor(or *http.Request, w http.ResponseWriter, oldPath, oldPathIp string, ...) error
- func (gw *HTTPGate) ForwardHTTP(w http.ResponseWriter, r *http.Request, pathH string)
- func (gw *HTTPGate) HttpForwardPath(w http.ResponseWriter, r *http.Request)
- func (gw *HTTPGate) HttpForwardPath2(w http.ResponseWriter, r *http.Request)
- func (gw *HTTPGate) HttpProxyCapture(addr string) error
- func (gw *HTTPGate) ProxyHttp(cl *http.Client, or *http.Request, w http.ResponseWriter, nurl, oldPath string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HTTPGate ¶
type HTTPGate struct {
// contains filtered or unexported fields
}
HTTPGate handles HTTP requests
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 ¶
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 ¶
Start listening on the addr, as a HTTP_PROXY Handles CONNECT and PROXY requests using the gateway for streams.