socks

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2015 License: BSD-2-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AcceptNoSocks = false

AcceptNoSocks allows workaround if no socks proxy is given

View Source
var ErrNoProxy = errors.New("socks: No proxy configured")

ErrNoProxy is returned if no proxy has been configured and AcceptNoSocks == false

View Source
var Timeout = int64(90)

Timeout for socks connections. In seconds

Functions

This section is empty.

Types

type Proxy

type Proxy string

Proxy is a socks proxy

func (Proxy) Create

func (sprox Proxy) Create() (*http.Client, error)

Create a new socks proxy

func (Proxy) Do

func (sprox Proxy) Do(req *http.Request) (resp *http.Response, err error)

Do a request

func (Proxy) Get

func (sprox Proxy) Get(url string) (*http.Response, error)

Get execute a get call

func (Proxy) Head

func (sprox Proxy) Head(url string) (resp *http.Response, err error)

Head call

func (Proxy) LimitGet

func (sprox Proxy) LimitGet(url string, limit int64) ([]byte, error)

LimitGet fetches at most limit bytes from url. Throws error if more data is available

func (Proxy) LimitPost

func (sprox Proxy) LimitPost(url string, bodyType string, body io.Reader, limit int64) ([]byte, error)

LimitPost posts body and reads a maximum of limit. Throws error if more data is available

func (Proxy) LimitPostBytes

func (sprox Proxy) LimitPostBytes(url string, bodyType string, body []byte, limit int64) ([]byte, error)

LimitPostBytes posts []byte and limits the return to limit. Throws error if more data is available

func (Proxy) Post

func (sprox Proxy) Post(url string, bodyType string, body io.Reader) (*http.Response, error)

Post execute a post call

func (Proxy) PostBytes

func (sprox Proxy) PostBytes(url string, bodyType string, body []byte) (*http.Response, error)

PostBytes makes a post of []byte

func (Proxy) PostForm

func (sprox Proxy) PostForm(url string, data urlPackage.Values) (resp *http.Response, err error)

PostForm posts a form. data is url.Values

Jump to

Keyboard shortcuts

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