profiles

package
v0.5.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ACCEPT                    = "accept"
	ACCEPT_ENCODING           = "accept-encoding"
	ACCEPT_LANGUAGE           = "accept-language"
	AUTHORIZATION             = "authorization"
	CACHE_CONTROL             = "cache-control"
	CONTENT_LENGTH            = "content-length"
	CONTENT_TYPE              = "content-type"
	COOKIE                    = "cookie"
	ORIGIN                    = "origin"
	PRIORITY                  = "priority"
	PRAGMA                    = "pragma"
	REFERER                   = "referer"
	SEC_CH_UA                 = "sec-ch-ua"
	SEC_CH_UA_MOBILE          = "sec-ch-ua-mobile"
	SEC_CH_UA_PLATFORM        = "sec-ch-ua-platform"
	SEC_FETCH_DEST            = "sec-fetch-dest"
	SEC_FETCH_MODE            = "sec-fetch-mode"
	SEC_FETCH_SITE            = "sec-fetch-site"
	SEC_FETCH_USER            = "sec-fetch-user"
	UPGRADE_INSECURE_REQUESTS = "upgrade-insecure-requests"
	USER_AGENT                = "user-agent"
)

Header names used in the browser profile.

Variables

This section is empty.

Functions

This section is empty.

Types

type H2Settings

type H2Settings struct {
	HeaderTableSize      uint32
	EnablePush           uint32
	MaxConcurrentStreams uint32
	InitialWindowSize    uint32
	MaxFrameSize         uint32
	MaxHeaderListSize    uint32
	ConnectionFlow       uint32
	InitialStreamID      uint32
	PriorityStreamDep    uint32
	PriorityExclusive    bool
	PriorityWeight       uint8
}

H2Settings represents the settings for the HTTP/2 protocol.

type H3Settings

type H3Settings struct {
	QpackMaxTableCapacity uint64
	MaxFieldSectionSize   uint64
	QpackBlockedStreams   uint64
	EnableConnectProtocol uint64
	H3Datagram            uint64
	SettingsH3Datagram    uint64
	EnableWebtransport    uint64
}

H3Settings represents the settings for the HTTP/3 protocol.

type HeaderCache

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

HeaderCache caches the order and enums of headers for desktop and mobile devices.

func NewHeaderCache

func NewHeaderCache(desktop, mobile map[string][]string) *HeaderCache

NewHeaderCache creates a new HeaderCache with the given desktop and mobile header orders.

func (*HeaderCache) Enums

func (hc *HeaderCache) Enums(isMobile bool) map[string]map[string]int

Enums returns the cached enums for the specified device type.

func (*HeaderCache) SortByOrder

func (hc *HeaderCache) SortByOrder(headers []HeaderEntry, method string, isMobile bool) []HeaderEntry

SortByOrder sorts the given headers according to the cached order and enums for the specified method and device type.

type HeaderEntry

type HeaderEntry struct {
	Name  string
	Value string
}

HeaderEntry represents a single header entry for the browser profile.

type OSKey

type OSKey int

OSKey represents the operating system key for the browser profile.

const (
	Windows OSKey = iota + 1
	MacOS
	Linux
	Android
	IOS
)

Possible OSKey values for the browser profile.

func (OSKey) IsMobile

func (k OSKey) IsMobile() bool

IsMobile returns true if the OSKey is a mobile device.

func (OSKey) Mobile

func (k OSKey) Mobile() string

Mobile returns the mobile string representation of the OSKey.

type Variant

type Variant struct {
	HelloSpec     *utls.ClientHelloSpec
	HelloID       utls.ClientHelloID
	BoundaryFunc  func() string
	ConfigureH2   func(*H2Settings)
	ConfigureH3   func(*H3Settings)
	BuildHeaders  func(OSKey) []HeaderEntry
	InsertHeaders func(headers map[string]string, method string)
}

Variant represents a single browser variant with its associated settings.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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