socks

package
v0.0.0-...-f6c5f6a Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2013 License: BSD-3-Clause Imports: 6 Imported by: 2

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 Proxy

type Proxy struct {
	Addr     string
	Username string
	Password string
}

func (*Proxy) Dial

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

Jump to

Keyboard shortcuts

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