cycletls

package module
v0.0.0-...-0df1a92 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2023 License: GPL-3.0 Imports: 30 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressBody

func DecompressBody(Body []byte, encoding []string, content []string) (parsedBody string)

DecompressBody unzips compressed data

func ParseDateString

func ParseDateString(dt string) (time.Time, error)

ParseDateString takes a string and passes it through Approxidate Parses into a time.Time

func PrettyStruct

func PrettyStruct(data interface{}) (string, error)

func StringToSpec

func StringToSpec(ja3 string, userAgent string) (*utls.ClientHelloSpec, error)

StringToSpec creates a ClientHelloSpec based on a JA3 string

func WSEndpoint

func WSEndpoint(w nhttp.ResponseWriter, r *nhttp.Request)

Types

type ContextKeyHeader

type ContextKeyHeader struct{}

ContextKeyHeader Users of context.WithValue should define their own types for keys

type Cookie struct {
	Name  string `json:"name"`
	Value string `json:"value"`

	Path        string `json:"path"`   // optional
	Domain      string `json:"domain"` // optional
	Expires     time.Time
	JSONExpires Time   `json:"expires"`    // optional
	RawExpires  string `json:"rawExpires"` // for reading cookies only

	// MaxAge=0 means no 'Max-Age' attribute specified.
	// MaxAge<0 means delete cookie now, equivalently 'Max-Age: 0'
	// MaxAge>0 means Max-Age attribute present and given in seconds
	MaxAge   int           `json:"maxAge"`
	Secure   bool          `json:"secure"`
	HTTPOnly bool          `json:"httpOnly"`
	SameSite http.SameSite `json:"sameSite"`
	Raw      string
	Unparsed []string `json:"unparsed"` // Raw text of unparsed attribute-value pairs
}

A Cookie represents an HTTP cookie as sent in the Set-Cookie header of an HTTP response or the Cookie header of an HTTP request.

See https://tools.ietf.org/html/rfc6265 for details. Stolen from Net/http/cookies

type CycleTLS

type CycleTLS struct {
	ReqChan  chan fullRequest
	RespChan chan Response
}

CycleTLS creates full request and response

func Init

func Init(workers ...bool) CycleTLS

Init starts the worker pool or returns a empty cycletls struct

func (CycleTLS) Close

func (client CycleTLS) Close()

Close closes channels

func (CycleTLS) Do

func (client CycleTLS) Do(URL string, options Options, Method string) (response Response, err error)

Do creates a single request

func (CycleTLS) Queue

func (client CycleTLS) Queue(URL string, options Options, Method string)

Queue queues request in worker pool

type Options

type Options struct {
	URL             string            `json:"url"`
	Method          string            `json:"method"`
	Headers         map[string]string `json:"headers"`
	Body            string            `json:"body"`
	Ja3             string            `json:"ja3"`
	UserAgent       string            `json:"userAgent"`
	Proxy           string            `json:"proxy"`
	Cookies         []Cookie          `json:"cookies"`
	Timeout         int               `json:"timeout"`
	DisableRedirect bool              `json:"disableRedirect"`
	HeaderOrder     []string          `json:"headerOrder"`
	OrderAsProvided bool              `json:"orderAsProvided"` //TODO
}

Options sets CycleTLS client options

type Response

type Response struct {
	RequestID string
	Status    int
	Body      string
	Headers   map[string]string
}

Response contains Cycletls response data

func (Response) JSONBody

func (re Response) JSONBody() map[string]interface{}

JSONBody converts response body to json

type Time

type Time struct {
	time.Time
}

Time wraps time.Time overriddin the json marshal/unmarshal to pass timestamp as integer

func (*Time) UnmarshalJSON

func (t *Time) UnmarshalJSON(buf []byte) error

UnmarshalJSON implements json.Unmarshaler inferface.

Directories

Path Synopsis
Package http provides HTTP client and server implementations.
Package http provides HTTP client and server implementations.
cgi
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
Package cgi implements CGI (Common Gateway Interface) as specified in RFC 3875.
cookiejar
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
Package cookiejar implements an in-memory RFC 6265-compliant http.CookieJar.
fcgi
Package fcgi implements the FastCGI protocol.
Package fcgi implements the FastCGI protocol.
http2
Package http2 implements the HTTP/2 protocol.
Package http2 implements the HTTP/2 protocol.
http2/h2c
Package h2c implements the unencrypted "h2c" form of HTTP/2.
Package h2c implements the unencrypted "h2c" form of HTTP/2.
http2/h2i
The h2i command is an interactive HTTP/2 console.
The h2i command is an interactive HTTP/2 console.
http2/hpack
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
Package hpack implements HPACK, a compression format for efficiently representing HTTP header fields in the context of HTTP/2.
httptest
Package httptest provides utilities for HTTP testing.
Package httptest provides utilities for HTTP testing.
httptrace
Package httptrace provides mechanisms to trace the events within HTTP client requests.
Package httptrace provides mechanisms to trace the events within HTTP client requests.
httputil
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
Package httputil provides HTTP utility functions, complementing the more common ones in the net/http package.
internal
Package internal contains HTTP internals shared by net/http and net/http/httputil.
Package internal contains HTTP internals shared by net/http and net/http/httputil.
internal/cfg
Package cfg holds configuration shared by the Go command and internal/testenv.
Package cfg holds configuration shared by the Go command and internal/testenv.
internal/nettrace
Package nettrace contains internal hooks for tracing activity in the net package.
Package nettrace contains internal hooks for tracing activity in the net package.
internal/profile
Package profile provides a representation of github.com/google/pprof/proto/profile.proto and methods to encode/decode/merge profiles in this format.
Package profile provides a representation of github.com/google/pprof/proto/profile.proto and methods to encode/decode/merge profiles in this format.
internal/race
Package race contains helper functions for manually instrumenting code for the race detector.
Package race contains helper functions for manually instrumenting code for the race detector.
internal/testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
pprof
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
Package pprof serves via its HTTP server runtime profiling data in the format expected by the pprof visualization tool.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
Package tls partially implements TLS 1.2, as specified in RFC 5246, and TLS 1.3, as specified in RFC 8446.
cpu
Package cpu implements processor feature detection used by the Go standard library.
Package cpu implements processor feature detection used by the Go standard library.
testenv
Package testenv provides information about what functionality is available in different testing environments run by the Go team.
Package testenv provides information about what functionality is available in different testing environments run by the Go team.

Jump to

Keyboard shortcuts

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