> For the complete documentation index, see [llms.txt](https://bogdanfinn.gitbook.io/open-source-oasis/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bogdanfinn.gitbook.io/open-source-oasis/readme/examples.md).

# Examples

Every example is one focused, standalone program under `./example/<topic>/` in the repository, runnable with `go run ./example/<topic>` and meant to be copied from directly.

### Requests

* [`./example/basic`](https://github.com/bogdanfinn/tls-client/tree/master/example/basic) - GET Request
* [`./example/post`](https://github.com/bogdanfinn/tls-client/tree/master/example/post) - POST Request
* [`./example/headers`](https://github.com/bogdanfinn/tls-client/tree/master/example/headers) - Custom Headers & [Header Order](/open-source-oasis/readme/request-headers.md)
* [`./example/cookies`](https://github.com/bogdanfinn/tls-client/tree/master/example/cookies) - [Cookie Jar](/open-source-oasis/readme/cookiejar.md)
* [`./example/redirects`](https://github.com/bogdanfinn/tls-client/tree/master/example/redirects) - Switching the Redirect Following Behavior
* [`./example/download`](https://github.com/bogdanfinn/tls-client/tree/master/example/download) - Downloading Image / Files
* [`./example/decompress`](https://github.com/bogdanfinn/tls-client/tree/master/example/decompress) - Manual [Response Body Decompression](/open-source-oasis/readme/response-body-encoding-decoding.md)

### Fingerprints

* [`./example/custom_profile`](https://github.com/bogdanfinn/tls-client/tree/master/example/custom_profile) - [Custom Client Profile](/open-source-oasis/readme/custom-client-profile.md) from a JA3 string, including the `trust_anchors` payload
* [`./example/custom_spec`](https://github.com/bogdanfinn/tls-client/tree/master/example/custom_spec) - Hand built `ClientHelloSpec` for extensions a JA3 string cannot express (PSK, ALPS)
* [`./example/session_tickets`](https://github.com/bogdanfinn/tls-client/tree/master/example/session_tickets) - Disabling TLS Session Tickets

### Connection

* [`./example/proxy`](https://github.com/bogdanfinn/tls-client/tree/master/example/proxy) - [Proxy](/open-source-oasis/readme/proxies.md) & Proxy Rotation
* [`./example/protocol_racing`](https://github.com/bogdanfinn/tls-client/tree/master/example/protocol_racing) - [Protocol Racing](/open-source-oasis/readme/protocol-racing.md) (HTTP/3 vs HTTP/2) and its SOCKS5 requirement
* [`./example/websocket`](https://github.com/bogdanfinn/tls-client/tree/master/example/websocket) - [WebSocket](/open-source-oasis/readme/websocket.md) with the client's TLS fingerprint
* [`./example/certificate_pinning`](https://github.com/bogdanfinn/tls-client/tree/master/example/certificate_pinning) - [Certificate Pinning](/open-source-oasis/readme/certificate-pinning.md)

### Concurrency

* [`./example/concurrency`](https://github.com/bogdanfinn/tls-client/tree/master/example/concurrency) - One client shared by many goroutines, decoding every response, with heap statistics and an optional pprof heap profile
* [`./example/client_per_worker`](https://github.com/bogdanfinn/tls-client/tree/master/example/client_per_worker) - The same setup with a client per worker instead of a shared one, counting the dials that a shared client would have avoided
* [`./example/connection_reuse`](https://github.com/bogdanfinn/tls-client/tree/master/example/connection_reuse) - Verifies that one TCP connection is reused across requests, counting dials and cross-checking with `httptrace`

### Observability

* [`./example/bandwidth`](https://github.com/bogdanfinn/tls-client/tree/master/example/bandwidth) - Bandwidth Tracking
* [`./example/hooks`](https://github.com/bogdanfinn/tls-client/tree/master/example/hooks) - Pre-Request & Post-Response Hooks

For the shared library and the standalone API the same topics are covered per language under `cffi_dist/`, see the [JavaScript](/open-source-oasis/shared-library/javascript/examples.md), [Python](/open-source-oasis/shared-library/python/examples.md), [TypeScript](/open-source-oasis/shared-library/typescript/examples.md) and [C#](/open-source-oasis/shared-library/c/examples.md) example pages.
