http

package
v0.0.0-...-a53ac42 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProxySingleConnection

func ProxySingleConnection(
	conn net.Conn,
	httpVersion string,
	startProxyCallback L7StartProxyCallback,
	endProxyCallback L7EndProxyCallback,
) error

ProxySingleConnection constructs an HTTP reverse proxy capable of proxying both HTTP 1.x and h2c (HTTP/2 without TLS) requests and uses it to serve the provided connection.

func Version

func Version(conn net.PeekableConn) string

Version peeks at a PeekableConn and attempts to determine whether it is being used for HTTP requests. If so, and it can recognize the HTTP version, the version is returned. In all other cases, an empty string is returned.

Types

type L7EndProxyCallback

type L7EndProxyCallback func(*http.Request) error

L7EndProxyCallback is the function signature for functions used as callbacks after an L7 proxy completes.

type L7StartProxyCallback

type L7StartProxyCallback func(*http.Request) (string, int, error)

L7StartProxyCallback is the function signature for functions used as callbacks before an L7 proxy starts.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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