http

package
v2.4.1 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

Package http provides HTTP clients for various HTTP protocols and operating systems

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Do(req *http.Request) (*http.Response, error)
}

Client is the interface for the HTTP client designed to mimic the http.Client

func NewHTTPClient

func NewHTTPClient(config Config) (client Client, err error)

NewHTTPClient creates a new HTTP client that implements the Client interface based on the configuration

type Config

type Config struct {
	ClientType Type
	Insecure   bool
	JA3        string
	Parrot     string
	Protocol   string
	ProxyURL   string
	ProxyUser  string
	ProxyPass  string
}

Config is the configuration for the HTTP client

type Type

type Type int

Type is the type of HTTP client to use from the constants in this package (e.g., HTTP, H2C, WINHTTP, etc.)

const (
	// UNDEFINED is the default value when a Type was not set
	UNDEFINED Type = iota
	// HTTP is HTTP/1.1 Clear-Text protocol
	HTTP
	// HTTPS is HTTP/1.1 Secure (over SSL/TLS) protocol
	HTTPS
	// H2C is HTTP/2.0 Clear-Text protocol
	H2C
	// HTTP2 is HTTP/2.0 Secure (over SSL/TLS)
	HTTP2
	// HTTP3 is HTTP/2.0 Secure over Quick UDP Internet Connection (QUIC)
	HTTP3
	// WINHTTP uses the Windows WinHTTP API
	WINHTTP
	// WININET uses the Windows WinINet API
	WININET
	// JA3 uses the JA3 fingerprinting library
	JA3
	// PARROT uses the Parrot HTTP client
	PARROT
)

Supported protocols

func (Type) String

func (t Type) String() string

String converts a protocol type constant to its string representation

Directories

Path Synopsis
Package http1 provides an HTTP/1.1 client using the Go standard library
Package http1 provides an HTTP/1.1 client using the Go standard library
Package http2 provides an HTTP/2 client
Package http2 provides an HTTP/2 client
Package http3 provides an HTTP/2 over QUIC, known as HTTP/3, client
Package http3 provides an HTTP/2 over QUIC, known as HTTP/3, client

Jump to

Keyboard shortcuts

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