headers

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2026 License: Apache-2.0 Imports: 7 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package headers generates realistic browser HTTP headers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BrowserName

func BrowserName(userAgent string) string

func Generate

func Generate(options Options) (map[string]string, error)

func MajorVersion

func MajorVersion(browser string) int

func Pascalize

func Pascalize(name string) string

func PascalizeHeaders

func PascalizeHeaders(headers map[string]string) map[string]string

func UserAgent

func UserAgent(headers map[string]string) string

Types

type Browser

type Browser struct {
	Name        string
	MinVersion  int
	MaxVersion  int
	HTTPVersion string
}

type Generator

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

func NewGenerator

func NewGenerator(options Options) (*Generator, error)

func (*Generator) Generate

func (g *Generator) Generate(options Options) (map[string]string, error)

func (*Generator) OrderHeaders

func (g *Generator) OrderHeaders(headers map[string]string) (map[string]string, error)

type HTTPBrowser

type HTTPBrowser struct {
	Name           string
	Version        []int
	CompleteString string
	HTTPVersion    string
}

func PrepareHTTPBrowser

func PrepareHTTPBrowser(value string) HTTPBrowser

func (HTTPBrowser) IsHTTP2

func (b HTTPBrowser) IsHTTP2() bool

type Options

type Options struct {
	Browsers                []Browser
	OperatingSystems        []string
	Devices                 []string
	Locales                 []string
	HTTPVersion             string
	Strict                  bool
	UserAgents              []string
	RequestDependentHeaders map[string]string
	RNG                     RNG
}

type RNG

type RNG = bayes.RNG

Jump to

Keyboard shortcuts

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