socks

package
v0.0.0-...-4720035 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2017 License: BSD-3-Clause Imports: 8 Imported by: 1,037

Documentation

Overview

Current limitations:

  • GSS-API authentication is not supported
  • only SOCKS version 5 is supported
  • TCP bind and UDP not yet supported

Example http client over SOCKS5:

proxy := &socks.Proxy{"127.0.0.1:1080"}
tr := &http.Transport{
	Dial: proxy.Dial,
}
client := &http.Client{Transport: tr}
resp, err := client.Get("https://example.com")

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAuthFailed             = errors.New("authentication failed")
	ErrInvalidProxyResponse   = errors.New("invalid proxy response")
	ErrNoAcceptableAuthMethod = errors.New("no acceptable authentication method")
)

Functions

This section is empty.

Types

type ProxiedAddr

type ProxiedAddr struct {
	Net  string
	Host string
	Port int
}

func (*ProxiedAddr) Network

func (a *ProxiedAddr) Network() string

func (*ProxiedAddr) String

func (a *ProxiedAddr) String() string

type Proxy

type Proxy struct {
	Addr         string
	Username     string
	Password     string
	TorIsolation bool
}

func (*Proxy) Dial

func (p *Proxy) Dial(network, addr string) (net.Conn, error)

func (*Proxy) DialTimeout

func (p *Proxy) DialTimeout(network, addr string, timeout time.Duration) (net.Conn, error)

Jump to

Keyboard shortcuts

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