Documentation
¶
Overview ¶
Package http2 implements a protocol.Protocol driver that speaks HTTP/2, over TLS (the normal case, negotiated via ALPN) or over plain TCP ("h2c") when the target is an http:// URL — many internal services run h2c precisely to skip TLS termination, and a load tester that only understood h2-over-TLS would be unable to test them at all.
Go's standard net/http client only ever negotiates HTTP/2 via TLS, so this driver is built directly on golang.org/x/net/http2's Transport instead of net/http's default one — that is the whole reason this package exists separately from http1.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is an HTTP/2 protocol.Protocol.
func New ¶
New returns a ready-to-use Driver for target. timeout bounds each individual request. New returns an error only if target.URL cannot be parsed at all — a malformed scheme or host is a configuration problem, not a per-request failure.