proxy

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Token is the Till auth token
	Token string

	// Instance is the name of this till instance
	Instance string

	// ForceUA indicates whether to overwrite all incoming user-agent with a random one
	ForceUA = true

	// UAType specifies what kind of user-agent to generate
	UAType = "desktop"

	// ProxyFile points to the path of the txt file that contains a list of proxies
	ProxyFile = ""

	// ProxyURLs are external proxies that will be randomized
	ProxyURLs = []string{}

	// ProxyCount is the total count of proxies used.
	ProxyCount int

	// ReleaseVersion is the version of Till release
	ReleaseVersion = "dev"

	StatMu *tillclient.InstanceStatMutex
)

Functions

func GenCA

func GenCA(name string) (certPEM, keyPEM []byte, err error)

func GenCert

func GenCert(names []string) (*tls.Certificate, error)

GenCert generates cert

func HandleHTTP

func HandleHTTP(sw http.ResponseWriter, sreq *http.Request) error

HandleHTTP proxies the request from source to target

func HandleTunneling

func HandleTunneling(sw http.ResponseWriter, sreq *http.Request) error

func Handshake

func Handshake(w http.ResponseWriter, config *tls.Config) (net.Conn, error)

Handshake hijacks w's underlying net.Conn, responds to the CONNECT request and manually performs the TLS handshake. It returns the net.Conn or and error if any.

func LoadOrGenCAFiles

func LoadOrGenCAFiles(caCertFile, caKeyFile string) (err error)

LoadOrGenCAFiles loads CA from file, or generates it into a file and use it

func LoadProxyFile

func LoadProxyFile(path string) (count int, err error)

LoadProxyFile will load the file, and

func NewPageFromRequest

func NewPageFromRequest(r *http.Request, scheme string, config *PageConfig) (p *pages.Page, err error)

Types

type PageConfig

type PageConfig struct {
	ForceUA  bool   // if true, overrides the User-Agent header
	UaType   string // default to "desktop"
	UseProxy bool
}

PageConfig is where the page configuration is set

Jump to

Keyboard shortcuts

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