h2

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: 17 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Set to the address of the AP master
	AndroidAPMaster string
)

Functions

func CleanQuic

func CleanQuic(httpClient *http.Client)

func InsecureHttp

func InsecureHttp() *http.Client

func NewSocksHttpClient

func NewSocksHttpClient(socksAddr string) *http.Client

NewSocksHttpClient returns a new client using SOCKS5 server.

func NewSocksHttpInsecure

func NewSocksHttpInsecure(socksAddr string) *http.Client

Returns a HTTP client using SOCKS gateway on the requested port.

func ProxyHttp

func ProxyHttp(addr string) *http.Client

Returns a HTTP client using HTTP PROXY and CONNECT

Types

type H2

type H2 struct {

	// Local mux is exposed on 127.0.0.1:5227
	// Status, UI.
	LocalMux *http.ServeMux

	// MTLS mux.
	// In DMesh it exposes register, tcp, admin
	MTLSMux *http.ServeMux

	Certs *auth.Auth

	GRPC *grpc.Server
	// contains filtered or unexported fields
}

H2 provides network communication over HTTP/2, QUIC, SSH It also handles the basic config loading - in particular certificates.

func NewH2

func NewH2(confdir string) (*H2, error)

Deprecated, test only

func NewTransport

func NewTransport(authz *auth.Auth) (*H2, error)

NewTransport initialized the H2 transport. Requires auth information for setting up TLS. Same certificate can be used for both server or client, like in Istio. This will also initialize a GRPC server and 2 Mux, one for localhost and one for ingress.

Verification is disabled in transport, but implemented in a wrapper, using authz.

func (*H2) Client

func (h2 *H2) Client(host string) *http.Client

Return a http.Client configured for the host.

func (*H2) HandlerWrapper

func (h2 *H2) HandlerWrapper(h http.Handler) *handlerWrapper

func (*H2) InitH2Server

func (h2 *H2) InitH2Server(port string, handler http.Handler, mtls bool) error

func (*H2) InitH2ServerListener

func (h2 *H2) InitH2ServerListener(tcpConn *net.TCPListener, handler http.Handler, requestTLSClient bool) error

Init a HTTPS server on a given listener. Will add TLS transport and certs !

func (*H2) InitMTLSServer

func (h2 *H2) InitMTLSServer(port int, handler http.Handler) error

Start QUIC and HTTPS servers on port, using handler.

Jump to

Keyboard shortcuts

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