net

package
v0.0.0-testwin2 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2021 License: GPL-3.0 Imports: 14 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimeout error = &TimeoutError{}

ErrTimeout is the singleton timeout error instance for CoyIM

Functions

func FindProxyTypeFor

func FindProxyTypeFor(s string) int

FindProxyTypeFor returns the index of the proxy type given

func GetProxyTypeFor

func GetProxyTypeFor(act string) string

GetProxyTypeFor will return the proxy type for the given i18n proxy name

func GetProxyTypeNames

func GetProxyTypeNames(f func(string))

GetProxyTypeNames will yield all i18n proxy names to the function

func LookupSRV

func LookupSRV(dialer proxy.Dialer, service, proto, name string) (cname string, addrs []*net.SRV, err error)

LookupSRV mirrors net.LookupSRV but uses the provided proxy dialer in order to do the lookup instead. By default it uses the OpenDNS server

func LookupSRVWith

func LookupSRVWith(dialer proxy.Dialer, dnsServer, service, proto, name string) (cname string, addrs []*net.SRV, err error)

LookupSRVWith looks up the provided service and protocol on the given name using the proxy dialer given and the dns server provided

Types

type CheckTorResult

type CheckTorResult struct {
	IsTor bool
	IP    string
}

CheckTorResult represents the JSON result from a check tor request

type Proxy

type Proxy struct {
	Scheme string
	User   *string
	Pass   *string
	Host   *string
	Port   *string
	Path   *string
}

Proxy contains information about a proxy specification

func ParseProxy

func ParseProxy(px string) Proxy

ParseProxy parses the given specification and returns a Proxy object with it

func (Proxy) ForPresentation

func (p Proxy) ForPresentation() string

ForPresentation represents a string valid for user presentation - blanking out the password

func (Proxy) ForProcessing

func (p Proxy) ForProcessing() string

ForProcessing represents a string valid for computer processing

type TimeoutError

type TimeoutError struct{}

TimeoutError represents a timeout error

func (*TimeoutError) Error

func (e *TimeoutError) Error() string

type TorState

type TorState interface {
	Detect() bool
	Address() string
	IsConnectionOverTor(proxy.Dialer) bool
}

TorState informs the state of Tor

var Tor TorState = &defaultTorManager{}

Tor is the default state manager for Tor

Jump to

Keyboard shortcuts

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