mimic

package module
v0.0.0-...-91d4ef1 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2023 License: GPL-3.0 Imports: 12 Imported by: 0

README

Mimic

Mimic chromium's HTTP/HTTP2 and TLS implementations.

Fork of https://github.com/saucesteals/mimic/ with changes aroung transport set up.

Documentation
Installation
go get github.com/ElementumOrg/mimic

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUnsupportedVersion = errors.New("mimic: unsupported version")
)
View Source
var (
	PlatformWindows platform = "win"
)

Functions

func GetLatestVersion

func GetLatestVersion(pf platform) (string, error)

GetLatestVersion returns the latest version of Chrome for the given platform.

func MustGetLatestVersion

func MustGetLatestVersion(pf platform) string

MustGetLatestVersion is like GetLatestVersion but panics on error.

Types

type Brand

type Brand string
var (
	BrandChrome Brand = "Google Chrome"
)

type ClientSpec

type ClientSpec struct {
	HTTP2Options *HTTP2Options
	GetTlsSpec   func() *utls.ClientHelloSpec
	// contains filtered or unexported fields
}

func Chromium

func Chromium(brand Brand, version string) (*ClientSpec, error)

func (*ClientSpec) ClientHintUA

func (c *ClientSpec) ClientHintUA() string

ClientHintUA returns the "sec-ch-ua" header value for the mimicked client.

func (*ClientSpec) ConfigureTransport

func (c *ClientSpec) ConfigureTransport(t1 *http.Transport) *http.Transport

ConfigureTransport configures a http.Transport to follow the client's spec Returns the given Transport for convenience

func (*ClientSpec) PseudoHeaderOrder

func (c *ClientSpec) PseudoHeaderOrder() []string

PseudoHeaderOrder returns the pseudo header order for the mimicked client.

func (*ClientSpec) Version

func (c *ClientSpec) Version() string

Version returns the version for the mimicked client..

type HTTP2Options

type HTTP2Options struct {
	Settings          []http2.Setting
	PseudoHeaderOrder []string
	MaxHeaderListSize uint32
	InitialWindowSize uint32
	HeaderTableSize   uint32
}

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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