Documentation
¶
Overview ¶
Package http1 implements a protocol.Protocol driver that speaks plain HTTP/1.1. It is the simplest of the four Phase 0 drivers and the reference implementation the others follow.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Options = slices.Clone(tlsconf.Keys)
Options are the -opt keys this driver accepts.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver struct {
// contains filtered or unexported fields
}
Driver is an HTTP/1.1 protocol.Protocol. It reuses one *http.Client (and the connection pool behind it) across every call to Do, so repeated iterations against the same target benefit from keep-alive the way a real client would.
Driver deliberately disables HTTP/2 on its transport, even if the target would otherwise negotiate it over TLS. That is the difference between this driver and internal/protocol/http2: a scenario author who picks http1 is asking to test the HTTP/1.1 path specifically, and should get it even against a server that prefers HTTP/2.
func New ¶
New returns a ready-to-use Driver for target. timeout bounds each individual request; it should normally be shorter than the executor's own run duration. A timeout of 0 means no per-request timeout beyond ctx's own deadline.
New returns an error for a bad URL or bad TLS files. A target that is merely unreachable is reported by Do.