browserhttp

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: BSD-3-Clause Imports: 6 Imported by: 0

README

go-browserhttp / browserhttp

CI Go Reference

A pure-Go (CGO=0) http.Client that presents a real Chrome TLS fingerprint via uTLS. Many sites 403 non-browser clients based largely on the TLS ClientHello; mimicking Chrome's ciphers/extensions/curves — plus a browser User-Agent and a warmed cookie jar — lets a plain Go client reach public endpoints with no host web view. Identical on macOS, Linux and Windows.

c := browserhttp.NewClient(30 * time.Second)
resp, err := c.Get("https://www.reddit.com/r/golang/hot.json")

Extracted from go-news-reader/reader; shared by any fetcher that must look like a browser.

License

BSD-3-Clause © the go-browserhttp/browserhttp authors.

Documentation

Overview

Package browserhttp builds a portable, pure-Go (CGO=0) http.Client that presents a real Chrome TLS fingerprint via uTLS. Many platforms (Reddit, Twitter, Instagram, TikTok) 403 non-browser clients based largely on the TLS ClientHello — Go's default handshake is trivially distinguishable from a browser's. Mimicking Chrome's ciphers/extensions/curves, plus a browser User-Agent and a warmed cookie jar, lets a plain Go client reach the public endpoints without any host web view. It works identically on macOS, Linux and Windows, and is shared by every provider that needs to look like a browser.

Index

Constants

View Source
const DefaultUserAgent = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) " +
	"AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"

DefaultUserAgent is a current desktop-Chrome User-Agent string. Providers set it (or their own) on outgoing requests; it is not applied automatically.

Variables

This section is empty.

Functions

func NewClient

func NewClient(timeout time.Duration) *http.Client

NewClient returns an http.Client whose TLS handshakes impersonate Chrome and which keeps cookies across requests.

func NewTransport

func NewTransport() *http.Transport

NewTransport returns an http.Transport that dials TLS with a Chrome fingerprint (forced to HTTP/1.1 so net/http drives the connection).

Types

This section is empty.

Jump to

Keyboard shortcuts

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