socks

package module
v0.0.0-...-473648b Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 License: BSD-2-Clause Imports: 7 Imported by: 0

README

SOCKS

SOCKS is a SOCKS4, SOCKS4A and SOCKS5 proxy package for Go.

Forkd from h12w/socks On this basis

  1. Proxy dialing added
  2. Change it to something like golang.org/x/net/proxy

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Username string
	Password string
}

type Dialer

type Dialer struct {
	ProxyDial func(context.Context, string, string) (net.Conn, error)
	Proto     Proto
	Host      string
	Auth      Auth
	Timeout   time.Duration
}

Dialer holds socks options.

func NewDialer

func NewDialer(addr string) (*Dialer, error)

NewDialer is create a new socks connection

func (*Dialer) Dial

func (d *Dialer) Dial(network string, address string) (net.Conn, error)

Dial connects to the provided address on the provided network.

func (*Dialer) DialContext

func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error)

DialContext connects to the provided address on the provided network.

type Proto

type Proto uint8
const (
	SOCKS4 Proto = iota
	SOCKS4A
	SOCKS5
)

Jump to

Keyboard shortcuts

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