Go port of BrowserForge, intended to provide realistic browser header and fingerprint generation for Go automation stacks.
This repository is intentionally separate from go-camoufox. BrowserForge is a reusable fingerprint/header generation engine, while go-camoufox is a Camoufox browser launcher/runtime.
The target is API and behavior parity with Python BrowserForge where practical:
headers.Generatorfor HTTP header generation.fingerprints.Generatorfor navigator, screen, codecs, WebGL, fonts, and related fingerprint data.- Bayesian-network sampling from the same Apify datapoint model used by Python BrowserForge.
- Go-friendly deterministic tests comparing constraints and generated shapes against the Python reference.
Implemented:
- Embedded Apify BrowserForge datapoints.
- Go Bayesian-network sampler compatible with the Python BrowserForge network shape.
- Header generation with browser, OS, device, locale, HTTP version, user-agent, and request-dependent header constraints.
- Fingerprint generation with BrowserForge screen constraints and navigator/header consistency.
- Tests for Firefox header generation, request-dependent headers, fingerprint screen constraints, and invalid constraints.
- Python reference parity matrix tests for Firefox desktop fingerprints across Windows, Linux, macOS, plus strict impossible screen constraints.
The Go API is idiomatic rather than a line-for-line Python API clone, but the generation model and data source are the same BrowserForge/Apify network files.
Python parity tests run automatically when a local Python BrowserForge reference
is available. Set BROWSERFORGE_PYTHON and BROWSERFORGE_PYTHONPATH to point
at an explicit reference environment.
package main
import (
"fmt"
"github.com/brainplusplus/go-browserforge/fingerprints"
"github.com/brainplusplus/go-browserforge/headers"
)
func main() {
fp, err := fingerprints.Generate(fingerprints.Options{
Screen: &fingerprints.Screen{
MinWidth: 1280,
MaxWidth: 1920,
MinHeight: 720,
MaxHeight: 1200,
},
Headers: headers.Options{
Browsers: []headers.Browser{{Name: "firefox", MinVersion: 135}},
OperatingSystems: []string{"windows"},
Devices: []string{"desktop"},
Locales: []string{"en-US"},
},
})
if err != nil {
panic(err)
}
fmt.Println(fp.Navigator.UserAgent)
fmt.Println(fp.Screen.Width, fp.Screen.Height)
}Apache License 2.0, matching the upstream BrowserForge and Apify fingerprint datapoints licensing.