network

package
v1.0.24 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2023 License: ISC Imports: 10 Imported by: 1

Documentation

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

func ParseListeners

func ParseListeners(addrs []string) ([]net.Addr, error)

parseListeners splits the list of listen addresses passed in addrs into IPv4 and IPv6 slices and returns them. This allows easy creation of the listeners on the correct interface "tcp4" and "tcp6". It also properly detects addresses which apply to "all interfaces" and adds the address to both slices.

Types

type ListenAddr

type ListenAddr struct {
	// contains filtered or unexported fields
}

func (ListenAddr) Network

func (a ListenAddr) Network() string

func (ListenAddr) String

func (a ListenAddr) String() string

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