{"id":13590867,"url":"https://github.com/bogdanfinn/tls-client","last_synced_at":"2026-02-04T11:19:11.625Z","repository":{"id":45301471,"uuid":"512278309","full_name":"bogdanfinn/tls-client","owner":"bogdanfinn","description":"net/http.Client like HTTP Client with options to select specific client TLS Fingerprints to use for requests. ","archived":false,"fork":false,"pushed_at":"2025-04-02T06:47:32.000Z","size":1161719,"stargazers_count":1053,"open_issues_count":31,"forks_count":187,"subscribers_count":29,"default_branch":"master","last_synced_at":"2025-04-02T07:24:46.591Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-4-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bogdanfinn.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"bogdanfinn","buy_me_a_coffee":"captainbarnius"}},"created_at":"2022-07-09T20:21:20.000Z","updated_at":"2025-04-02T06:47:33.000Z","dependencies_parsed_at":"2023-09-22T07:22:53.967Z","dependency_job_id":"3254f507-f1ae-4934-bd33-cfdafaeca824","html_url":"https://github.com/bogdanfinn/tls-client","commit_stats":{"total_commits":257,"total_committers":22,"mean_commits":"11.681818181818182","dds":"0.14396887159533078","last_synced_commit":"077a497dc1047d3ed5f53f257af383b334a7a609"},"previous_names":[],"tags_count":84,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdanfinn%2Ftls-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdanfinn%2Ftls-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdanfinn%2Ftls-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bogdanfinn%2Ftls-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bogdanfinn","download_url":"https://codeload.github.com/bogdanfinn/tls-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247860771,"owners_count":21008349,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:00:51.294Z","updated_at":"2026-02-04T11:19:11.619Z","avatar_url":"https://github.com/bogdanfinn.png","language":"Go","funding_links":["https://github.com/sponsors/bogdanfinn","https://buymeacoffee.com/captainbarnius","https://www.buymeacoffee.com/CaptainBarnius"],"categories":["Go","Networking","Recently Updated","Credits","网络","Fingerprinting Evasion"],"sub_categories":["HTTP Clients","[Dec 24, 2024](/content/2024/12/24/README.md)","HTTP客户端","Index"],"readme":"# TLS-Client\n\n### Preface\n\nThis TLS Client is built upon https://github.com/Carcraftz/fhttp and https://github.com/Carcraftz/utls (https://github.com/refraction-networking/utls). Big thanks to\nall contributors so far. Sadly it seems that the original repositories from Carcraftz are not maintained anymore.\n\n### What is TLS Fingerprinting?\n\nSome people think it is enough to change the user-agent header of a request to let the server think that the client\nrequesting a resource is a specific browser.\nNowadays this is not enough, because the server might use a technique to detect the client browser which is called TLS\nFingerprinting.\n\nEven though this article is about TLS Fingerprinting in NodeJS it well describes the technique in general.\nhttps://httptoolkit.tech/blog/tls-fingerprinting-node-js/#how-does-tls-fingerprinting-work\n\n### Why is this library needed?\n\nWith this library you are able to create a http client implementing an interface which is similar to golangs net/http\nclient interface.\nThis TLS Client allows you to specify the Client (Browser and Version) you want to use, when requesting a server.\n\n### Features\n\n- ✅ **HTTP/1.1, HTTP/2, HTTP/3** - Full protocol support with automatic negotiation\n- ✅ **Protocol Racing** - Chrome-like \"Happy Eyeballs\" for HTTP/2 vs HTTP/3\n- ✅ **TLS Fingerprinting** - Mimic Chrome, Firefox, Safari, and other browsers\n- ✅ **HTTP/3 Fingerprinting** - Accurate QUIC/HTTP/3 fingerprints matching real browsers\n- ✅ **WebSocket Support** - Maintain TLS fingerprinting over WebSocket connections\n- ✅ **Custom Header Ordering** - Control the order of HTTP headers\n- ✅ **Proxy Support** - HTTP and SOCKS5 proxies\n- ✅ **Cookie Jar Management** - Built-in cookie handling\n- ✅ **Certificate Pinning** - Enhanced security with custom certificate validation\n- ✅ **Bandwidth Tracking** - Monitor upload/download bandwidth\n- ✅ **Language Bindings** - Use from JavaScript (Node.js), Python, and C# via FFI\n\n### Interface\n\nThe HTTP Client interface extends the base net/http Client with additional functionality:\n\n```go\ntype HttpClient interface {\n    GetCookies(u *url.URL) []*http.Cookie\n    SetCookies(u *url.URL, cookies []*http.Cookie)\n    SetCookieJar(jar http.CookieJar)\n    GetCookieJar() http.CookieJar\n    SetProxy(proxyUrl string) error\n    GetProxy() string\n    SetFollowRedirect(followRedirect bool)\n    GetFollowRedirect() bool\n    CloseIdleConnections()\n    Do(req *http.Request) (*http.Response, error)\n    Get(url string) (resp *http.Response, err error)\n    Head(url string) (resp *http.Response, err error)\n    Post(url, contentType string, body io.Reader) (resp *http.Response, err error)\n\n    GetBandwidthTracker() bandwidth.BandwidthTracker\n    GetDialer() proxy.ContextDialer\n    GetTLSDialer() TLSDialerFunc\n}\n```\n\n### Detailed Documentation\n\nhttps://bogdanfinn.gitbook.io/open-source-oasis/\n\n### Quick Usage Example\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"io\"\n\t\"log\"\n\n\thttp \"github.com/bogdanfinn/fhttp\"\n\ttls_client \"github.com/bogdanfinn/tls-client\"\n\t\"github.com/bogdanfinn/tls-client/profiles\"\n)\n\nfunc main() {\n\tjar := tls_client.NewCookieJar()\n\toptions := []tls_client.HttpClientOption{\n\t\ttls_client.WithTimeoutSeconds(30),\n\t\ttls_client.WithClientProfile(profiles.Chrome_144),\n\t\ttls_client.WithNotFollowRedirects(),\n\t\ttls_client.WithCookieJar(jar), // create cookieJar instance and pass it as argument\n\t}\n\n\tclient, err := tls_client.NewHttpClient(tls_client.NewNoopLogger(), options...)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\treq, err := http.NewRequest(http.MethodGet, \"https://tls.peet.ws/api/all\", nil)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\treq.Header = http.Header{\n\t\t\"accept\":                    {\"*/*\"},\n\t\t\"accept-language\":           {\"de-DE,de;q=0.9,en-US;q=0.8,en;q=0.7\"},\n\t\t\"user-agent\":                {\"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36\"},\n\t\thttp.HeaderOrderKey: {\n\t\t\t\"accept\",\n\t\t\t\"accept-language\",\n\t\t\t\"user-agent\",\n\t\t},\n\t}\n\n\tresp, err := client.Do(req)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tdefer resp.Body.Close()\n\n\tlog.Println(fmt.Sprintf(\"status code: %d\", resp.StatusCode))\n\n\treadBytes, err := io.ReadAll(resp.Body)\n\tif err != nil {\n\t\tlog.Println(err)\n\t\treturn\n\t}\n\n\tlog.Println(string(readBytes))\n}\n```\n\n### Questions?\n\nJoin my discord support server for free: https://discord.gg/7Ej9eJvHqk\nNo Support in DMs!\n\n\n### Appreciate my work?\n\n[![\"Buy Me A Coffee\"](https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png)](https://www.buymeacoffee.com/CaptainBarnius)\n\n---\n\n## 🛡️ Need Antibot Bypass?\n\n\u003ca href=\"https://hypersolutions.co/?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=tls-client\" target=\"_blank\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/bogdanfinn/tls-client/master/.github/assets/hypersolutions.jpg\" height=\"47\" width=\"149\"\u003e\u003c/a\u003e\n\nTLS fingerprinting alone isn't enough for modern bot protection. **[Hyper Solutions](https://hypersolutions.co?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=tls-client)** provides the missing piece - API endpoints that generate valid antibot tokens for:\n\n**Akamai** • **DataDome** • **Kasada** • **Incapsula**\n\nNo browser automation. Just simple API calls that return the exact cookies and headers these systems require.\n\n🚀 **[Get Your API Key](https://hypersolutions.co?utm_source=github\u0026utm_medium=readme\u0026utm_campaign=tls-client)** | 📖 **[Docs](https://docs.justhyped.dev)** | 💬 **[Discord](https://discord.gg/akamai)**\n\n---\n\n### Powered by\n[![JetBrains logo.](https://resources.jetbrains.com/storage/products/company/brand/logos/jetbrains.svg)](https://jb.gg/OpenSource)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdanfinn%2Ftls-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbogdanfinn%2Ftls-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbogdanfinn%2Ftls-client/lists"}