viaproxy

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2019 License: MIT Imports: 11 Imported by: 0

README

Go Report Card GoDoc Build status

viaproxy

viaproxy is a proxy connection library.

It provides the interface Connector and two implementations: viaSOCKS5 and viaNoProxy.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Connector

type Connector interface {
	AddProxyAddr(addr ...string)
	GetProxyAddr() string
	RemoveProxyAddr(addr string)
	ErrorsCount(addr string, inc bool) int
	DoRequest(method string, url string, body io.Reader, timeout time.Duration) (Response, error)
}

Connector is a proxy connector

func NewViaNoProxy

func NewViaNoProxy(headers http.Header) Connector

NewViaNoProxy returns a new proxy connector via no proxy

func NewViaSOCKS5

func NewViaSOCKS5(headers http.Header) Connector

NewViaSOCKS5 returns a new proxy connector via SOCKS5

type Response

type Response struct {
	*http.Response

	// ProxyAddr is a proxy address via which a request was performed
	ProxyAddr string
}

Response is a response for a request

Jump to

Keyboard shortcuts

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