Documentation ¶
Index ¶
- func CheckTCPConnectivityWithHTTP(client shadowsocks.Client, targetURL string) error
- func CheckUDPConnectivityWithDNS(client shadowsocks.Client, resolverAddr net.Addr) error
- func NewTCPHandler(host string, port int, password, cipher string, tk string) core.TCPConnHandler
- func NewUDPHandler(host string, port int, password, cipher string, timeout time.Duration, ...) core.UDPConnHandler
- type AuthenticationError
- type ReachabilityError
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 ¶
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.