example/

directory
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2026 License: BSD-3-Clause

Directories

Path Synopsis
Package main shows the bandwidth tracker: how many bytes the client read and wrote on the wire, measured on the connection rather than on the response body, so TLS and header overhead are included.
Package main shows the bandwidth tracker: how many bytes the client read and wrote on the wire, measured on the connection rather than on the response body, so TLS and header overhead are included.
Package main shows the smallest possible tls-client setup: create a client with a browser profile and perform a GET request.
Package main shows the smallest possible tls-client setup: create a client with a browser profile and perform a GET request.
Package main shows certificate pinning: the request is rejected if the server does not present one of the configured public key hashes.
Package main shows certificate pinning: the request is rejected if the server does not present one of the configured public key hashes.
Package main is ./example/concurrency with one change: every worker builds its own tls-client instead of sharing one.
Package main is ./example/concurrency with one change: every worker builds its own tls-client instead of sharing one.
Package main shows one tls-client shared by many goroutines.
Package main shows one tls-client shared by many goroutines.
Package main verifies that a client reuses one TCP connection for subsequent requests to the same host, instead of dialing and handshaking again every time.
Package main verifies that a client reuses one TCP connection for subsequent requests to the same host, instead of dialing and handshaking again every time.
Package main shows automatic cookie persistence via the cookie jar, plus reading and manually seeding cookies for a URL.
Package main shows automatic cookie persistence via the cookie jar, plus reading and manually seeding cookies for a URL.
Package main shows how to build a client profile from a raw JA3 string instead of picking one of the bundled browser profiles.
Package main shows how to build a client profile from a raw JA3 string instead of picking one of the bundled browser profiles.
Package main shows how to build a tls.ClientHelloSpec by hand instead of deriving it from a JA3 string.
Package main shows how to build a tls.ClientHelloSpec by hand instead of deriving it from a JA3 string.
Package main shows manual response body decompression.
Package main shows manual response body decompression.
Package main shows downloading a binary response (e.g.
Package main shows downloading a binary response (e.g.
Package main shows how to set custom request headers and control the exact order they are sent in.
Package main shows how to set custom request headers and control the exact order they are sent in.
Package main shows pre-request and post-response hooks: one place to touch every request a client sends and every response it receives, without wrapping each call site.
Package main shows pre-request and post-response hooks: one place to touch every request a client sends and every response it receives, without wrapping each call site.
Package main shows a POST request with a JSON body.
Package main shows a POST request with a JSON body.
Package main shows protocol racing: HTTP/3 (QUIC) and HTTP/2 (TCP) are started in parallel and whichever connects first serves the request, similar to Chrome's "Happy Eyeballs" approach.
Package main shows protocol racing: HTTP/3 (QUIC) and HTTP/2 (TCP) are started in parallel and whichever connects first serves the request, similar to Chrome's "Happy Eyeballs" approach.
Package main shows how to route requests through a proxy and how to rotate to a different proxy on an existing client without rebuilding it.
Package main shows how to route requests through a proxy and how to rotate to a different proxy on an existing client without rebuilding it.
Package main shows how to toggle automatic redirect following at runtime, without rebuilding the client.
Package main shows how to toggle automatic redirect following at runtime, without rebuilding the client.
Package main shows how to turn off TLS session tickets.
Package main shows how to turn off TLS session tickets.
Package main shows a WebSocket connection that reuses the TLS fingerprint of a tls-client.
Package main shows a WebSocket connection that reuses the TLS fingerprint of a tls-client.

Jump to

Keyboard shortcuts

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