socks

package
v0.0.0-...-4f0ab6e Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT, BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrAuthFailed returns error information when auth failed.
	ErrAuthFailed = errors.New("authentication failed")
	// ErrInvalidProxyResponse returns error information when catch an invalid proxy response.
	ErrInvalidProxyResponse = errors.New("invalid proxy response")
	// ErrNoAcceptableAuthMethod returns error information when there is no acceptable authentication method.
	ErrNoAcceptableAuthMethod = errors.New("no acceptable authentication method")
)

Functions

This section is empty.

Types

type ProxiedAddr

type ProxiedAddr struct {
	Net  string
	Host string
	Port int
}

ProxiedAddr is used for proxy address.

func (*ProxiedAddr) Network

func (a *ProxiedAddr) Network() string

Network returns the net of ProxiedAddr.

func (*ProxiedAddr) String

func (a *ProxiedAddr) String() string

String will print the ip address and port of proxied address.

type Proxy

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

Proxy defines the data structure.

func (*Proxy) Dial

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

Dial calls to given address and returns its connection.

func (*Proxy) DialTimeout

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

DialTimeout calls to given address and returns its connection within the limit time.

Jump to

Keyboard shortcuts

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