shadowsocks

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

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

Go to latest
Published: Apr 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckTCPConnectivityWithHTTP

func CheckTCPConnectivityWithHTTP(client shadowsocks.Client, targetURL string) error

CheckTCPConnectivityWithHTTP determines whether the proxy is reachable over TCP and validates the client's authentication credentials by performing an HTTP HEAD request to `targetURL`, which must be of the form: http://[host](:[port])(/path). Returns nil on success, error if `targetURL` is invalid, AuthenticationError or ReachabilityError on connectivity failure.

func CheckUDPConnectivityWithDNS

func CheckUDPConnectivityWithDNS(client shadowsocks.Client, resolverAddr net.Addr) error

CheckUDPConnectivityWithDNS determines whether the Shadowsocks proxy represented by `client` and the network support UDP traffic by issuing a DNS query though a resolver at `resolverAddr`. Returns nil on success or an error on failure.

func NewTCPHandler

func NewTCPHandler(host string, port int, password, cipher string, tk string) core.TCPConnHandler

NewTCPHandler returns a Shadowsocks TCP connection handler.

`host` is the hostname of the Shadowsocks proxy server. `port` is the port of the Shadowsocks proxy server. `password` is password used to authenticate to the server. `cipher` is the encryption cipher of the Shadowsocks proxy.

func NewUDPHandler

func NewUDPHandler(host string, port int, password, cipher string, timeout time.Duration, tk string) core.UDPConnHandler

NewUDPHandler returns a Shadowsocks UDP connection handler.

`host` is the hostname of the Shadowsocks proxy server. `port` is the port of the Shadowsocks proxy. `password` is password used to authenticate to the proxy. `cipher` is the encryption cipher of the Shadowsocks proxy. `timeout` is the UDP read and write timeout.

Types

type AuthenticationError

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

AuthenticationError is used to signal failed authentication to the Shadowsocks proxy.

type ReachabilityError

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

ReachabilityError is used to signal an unreachable proxy.

Jump to

Keyboard shortcuts

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