profile

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package profile provides browser fingerprint profiles for TLS and HTTP/2. It includes pre-configured profiles for major browsers (Chrome, Firefox, Safari) and utilities for parsing fingerprint data from sources like tls.peet.ws.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Chrome143Headers

func Chrome143Headers() map[string]string

Chrome143Headers returns default Chrome 143 HTTP headers.

func Firefox146Headers

func Firefox146Headers() map[string]string

Firefox146Headers returns default Firefox 146 HTTP headers.

func ParseCipherSuites

func ParseCipherSuites(names []string) []uint16

ParseCipherSuites converts cipher suite names to their numeric IDs.

func ParseJA3

func ParseJA3(ja3 string) (extensions []uint16, curves []tls.CurveID, pointFormats []uint8)

ParseJA3 parses a JA3 fingerprint string and returns extensions, curves, and point formats. JA3 format: "TLSVersion,Ciphers,Extensions,Curves,PointFormats"

func Safari261Headers

func Safari261Headers() map[string]string

Safari261Headers returns default Safari 26.1 HTTP headers.

Types

type BrowserProfile

type BrowserProfile struct {
	UserAgent string       `json:"user_agent"`
	TLS       TLSProfile   `json:"tls"`
	HTTP2     HTTP2Profile `json:"http2"`
	HTTP3     *HTTP3Profile
	// contains filtered or unexported fields
}

BrowserProfile represents a complete browser fingerprint from tls.peet.ws.

func Chrome143

func Chrome143() *BrowserProfile

Chrome143 returns a hardcoded Chrome 143 browser profile.

func Firefox146

func Firefox146() *BrowserProfile

Firefox146 returns a hardcoded Firefox 146 browser profile.

func ParseJSON

func ParseJSON(data []byte) (*BrowserProfile, error)

ParseJSON parses a tls.peet.ws JSON response into a BrowserProfile.

func Safari261

func Safari261() *BrowserProfile

Safari261 returns a hardcoded Safari 26.1 (macOS) browser profile.

func (*BrowserProfile) CipherIDs

func (p *BrowserProfile) CipherIDs() []uint16

CipherIDs returns the parsed cipher suite IDs.

func (*BrowserProfile) Curves

func (p *BrowserProfile) Curves() []tls.CurveID

Curves returns the parsed elliptic curves.

func (*BrowserProfile) Extensions

func (p *BrowserProfile) Extensions() []uint16

Extensions returns the parsed TLS extension IDs.

func (*BrowserProfile) H2Settings

func (p *BrowserProfile) H2Settings() []HTTP2Setting

H2Settings returns the HTTP/2 settings.

func (*BrowserProfile) HTTP3Settings

func (p *BrowserProfile) HTTP3Settings() *HTTP3Profile

HTTP3Settings returns the HTTP/3 profile, or nil if not set.

func (*BrowserProfile) HeaderOrder

func (p *BrowserProfile) HeaderOrder() []string

HeaderOrder returns the HTTP/2 header order.

func (*BrowserProfile) PointFormats

func (p *BrowserProfile) PointFormats() []uint8

PointFormats returns the parsed EC point formats.

func (*BrowserProfile) PseudoHeaderOrder

func (p *BrowserProfile) PseudoHeaderOrder() []string

PseudoHeaderOrder returns the HTTP/2 pseudo-header order (e.g., m,a,s,p).

func (*BrowserProfile) WindowUpdate

func (p *BrowserProfile) WindowUpdate() uint32

WindowUpdate returns the HTTP/2 window update increment.

type HTTP2Profile

type HTTP2Profile struct {
	AkamaiFingerprint string      `json:"akamai_fingerprint"`
	SentFrames        []SentFrame `json:"sent_frames"`
}

HTTP2Profile contains HTTP/2 fingerprint data.

type HTTP2Setting

type HTTP2Setting struct {
	ID  uint16
	Val uint32
}

HTTP2Setting represents an HTTP/2 SETTINGS parameter.

func ParseAkamaiFingerprint

func ParseAkamaiFingerprint(fp string) (settings []HTTP2Setting, windowUpdate uint32, pseudoOrder []string)

ParseAkamaiFingerprint parses an Akamai fingerprint string. Format: "1:65536;2:0;4:6291456;6:262144|15663105|0|m,a,s,p"

type HTTP3Profile

type HTTP3Profile struct {

	// MaxIdleTimeout is the maximum idle timeout for the connection.
	// Browsers typically use 30-60 seconds.
	MaxIdleTimeout time.Duration

	// MaxUDPPayloadSize is the maximum UDP payload size.
	// Default is 65527 (max QUIC allows).
	MaxUDPPayloadSize uint16

	// InitialMaxData is the initial connection-level flow control limit.
	// Chrome: 15728640 (15MB), Firefox: 10485760 (10MB)
	InitialMaxData uint64

	// InitialMaxStreamDataBidiLocal is the initial stream-level flow control
	// limit for locally-initiated bidirectional streams.
	InitialMaxStreamDataBidiLocal uint64

	// InitialMaxStreamDataBidiRemote is the initial stream-level flow control
	// limit for remotely-initiated bidirectional streams.
	InitialMaxStreamDataBidiRemote uint64

	// InitialMaxStreamDataUni is the initial stream-level flow control
	// limit for unidirectional streams.
	InitialMaxStreamDataUni uint64

	// InitialMaxStreamsBidi is the initial maximum number of bidirectional streams.
	InitialMaxStreamsBidi uint64

	// InitialMaxStreamsUni is the initial maximum number of unidirectional streams.
	InitialMaxStreamsUni uint64

	// ActiveConnectionIDLimit is the maximum number of connection IDs to maintain.
	ActiveConnectionIDLimit uint64

	// ConnectionIDLength is the length of connection IDs generated by this client.
	// Browsers typically use 8-20 bytes. 0 means use implementation default.
	ConnectionIDLength uint8

	// QPackMaxTableCapacity is the maximum size of the dynamic QPACK table.
	// Chrome: 16384, Firefox: 65536
	QPackMaxTableCapacity uint64

	// QPackBlockedStreams is the maximum number of streams that can be blocked
	// waiting for QPACK updates.
	QPackBlockedStreams uint64

	// MaxFieldSectionSize is the maximum size of a field section (headers).
	// Most browsers use 16384 or higher.
	MaxFieldSectionSize uint64

	// EnableDatagrams indicates whether QUIC datagrams are supported.
	EnableDatagrams bool
}

HTTP3Profile contains QUIC transport parameters and HTTP/3 settings for fingerprinting. These values are sent during the QUIC handshake and can be used to identify the client implementation.

func Chrome143HTTP3

func Chrome143HTTP3() *HTTP3Profile

Chrome143HTTP3 returns HTTP/3 profile for Chrome 143. Values captured from browserleaks.com/quic on 2026-01-05.

func Firefox146HTTP3

func Firefox146HTTP3() *HTTP3Profile

Firefox146HTTP3 returns HTTP/3 profile for Firefox 146. Values captured from browserleaks.com/quic on 2026-01-05.

func Safari261HTTP3

func Safari261HTTP3() *HTTP3Profile

Safari261HTTP3 returns HTTP/3 profile for Safari 26.2. Values captured from browserleaks.com/quic on 2026-01-05.

type SentFrame

type SentFrame struct {
	FrameType string   `json:"frame_type"`
	Settings  []string `json:"settings,omitempty"`
	Increment int      `json:"increment,omitempty"`
	Headers   []string `json:"headers,omitempty"`
}

SentFrame represents a frame from tls.peet.ws output.

type TLSProfile

type TLSProfile struct {
	Ciphers []string `json:"ciphers"`
	JA3     string   `json:"ja3"`
	JA3Hash string   `json:"ja3_hash"`
	JA4     string   `json:"ja4"`
}

TLSProfile contains TLS fingerprint data.

Jump to

Keyboard shortcuts

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