Documentation
¶
Overview ¶
Package httpspeed implements core.SpeedTester against Cloudflare's public speed-test endpoint. No API key or self-hosted server required.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tester ¶
type Tester struct {
Client *http.Client
BaseURL string // overridable for tests; defaults to Cloudflare in New().
}
Tester times HTTP transfers against a speed-test server.
func (Tester) Colo ¶ added in v0.2.0
Colo returns the three-letter code of the Cloudflare datacenter that answered (e.g. "GRU" for São Paulo), or "" if it can't be determined. speed.cloudflare.com is anycast: the same URL always routes to whichever of Cloudflare's ~300 edges is closest, so this exists to make that concrete instead of asserting it — hits Cloudflare's public trace endpoint, which every Cloudflare-proxied hostname serves.
Click to show internal directories.
Click to hide internal directories.