fingerprint

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package fingerprint provides interfaces and implementations for controlling outbound TLS connection fingerprints.

Index

Constants

This section is empty.

Variables

View Source
var NameTable = map[string]utls.ClientHelloID{
	"chrome-120":    utls.HelloChrome_120,
	"chrome-120-pq": utls.HelloChrome_120_PQ,
	"firefox-120":   utls.HelloFirefox_120,
	"safari-16":     utls.HelloSafari_16_0,
	"edge-106":      utls.HelloEdge_106,
}

NameTable maps human-readable profile names to utls ClientHelloID presets.

View Source
var Table = map[string]utls.ClientHelloID{
	"t13d1516h2_8daaf6152771_02713d6af862": utls.HelloChrome_120,
	"t13d1715h2_5b57614c22b0_5c2c66f702b0": utls.HelloFirefox_120,
	"t13d2014h2_a09f3c656075_14788d8d241b": utls.HelloSafari_16_0,
	"t13d1516h2_8daaf6152771_e5627efa2ab1": utls.HelloEdge_106,
}

Table maps known JA4-TLS fingerprint hashes to utls ClientHelloID presets.

Hashes are measured empirically against tlsinfo.me using cmd/probe — they reflect what the utls preset actually emits, not captures from real browsers. Re-run cmd/probe after upgrading the utls dependency to verify they still match.

Note: HelloChrome_120_PQ produces the same JA4 as HelloChrome_120 because the post-quantum key share (X25519MLKEM768) falls in a key_share extension entry that JA4 does not distinguish. Use HelloChrome_120_PQ directly in dialTarget if you specifically need the PQ key exchange behaviour.

Functions

func ComputeJA4 added in v0.0.2

func ComputeJA4(ch *ClientHelloFields) string

func Lookup

func Lookup(ja4 string) (utls.ClientHelloID, bool)

Types

type Applier

type Applier interface {
	Name() string
}

type ClientHelloFields added in v0.0.2

type ClientHelloFields struct {
	LegacyVersion     uint16
	CipherSuites      []uint16 // non-GREASE, wire order
	Extensions        []uint16 // non-GREASE extension types, wire order
	SNIHost           string
	SNIIsIP           bool
	SupportedVersions []uint16 // from ext 0x002b, non-GREASE
	ALPNValues        []string // from ext 0x0010
	SigAlgs           []uint16 // from ext 0x000d, wire order
}

ClientHelloFields holds the parsed TLS ClientHello data used to compute JA4.

func ParseClientHello added in v0.0.2

func ParseClientHello(raw []byte) (*ClientHelloFields, error)

ParseClientHello parses the first TLS handshake record from raw. raw must start with a handshake record header (content type 0x16).

type TLSApplier

type TLSApplier interface {
	Applier
	ClientHelloID() utls.ClientHelloID
}

TLSApplier controls the uTLS ClientHello fingerprint for outbound connections.

type TLSFingerprint

type TLSFingerprint struct {
	// contains filtered or unexported fields
}

func ByName added in v0.0.2

func ByName(name string) (*TLSFingerprint, error)

func (*TLSFingerprint) ClientHelloID

func (f *TLSFingerprint) ClientHelloID() utls.ClientHelloID

func (*TLSFingerprint) Name

func (f *TLSFingerprint) Name() string

Jump to

Keyboard shortcuts

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