h2c

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dialer

type Dialer struct {
	Dialer    *net.Dialer
	TLSConfig *tls.Config
	URL       *url.URL
}

Dialer connects to a HTTP 1.1 server and performs an h2c upgrade to an HTTP2 connection.

func (Dialer) Dial

func (d Dialer) Dial(network, addr string) (net.Conn, error)

Dial connects to the address on the named network.

func (Dialer) DialContext

func (d Dialer) DialContext(ctx context.Context, network, addr string) (net.Conn, error)

DialContext connects to the address on the named network using the provided context.

func (Dialer) DialGRPC

func (d Dialer) DialGRPC(addr string, timeout time.Duration) (net.Conn, error)

DialGRPC connects to the address before timeout. Deprecated: use DialGRPCContext and grpc.WithContextDialer.

func (Dialer) DialGRPCContext added in v1.6.0

func (d Dialer) DialGRPCContext(ctx context.Context, addr string) (net.Conn, error)

DialGRPCContext implements the interface required by grpc.WithContextDialer.

type Server

type Server struct {
	HTTP2Handler      http.Handler
	NonUpgradeHandler http.Handler
}

Server is an HTTP 1.1 server that can detect h2c upgrades and serve them by an HTTP2 handler.

func (*Server) ServeHTTP

func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

Jump to

Keyboard shortcuts

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