Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAddr ¶
NewAddr returns a net.Addr that holds an address of the form `host:port` with a domain name or IP as host. Used for SOCKS addressing.
func NewPrefixSaltGenerator ¶
func NewPrefixSaltGenerator(prefix []byte) ss.SaltGenerator
NewPrefixSaltGenerator returns a SaltGenerator whose output consists of the provided prefix, followed by random bytes. This is useful to change how shadowsocks traffic is classified by middleboxes.
Note: Prefixes steal entropy from the initialization vector. This weakens security by increasing the likelihood that the same IV is used in two different connections (which becomes likely once 2^(N/2) connections are made, due to the birthday attack). If an IV is reused, the attacker can not only decrypt the ciphertext of those two connections; they can also easily recover the shadowsocks key and decrypt all other connections to this server. Use with care!
Types ¶
type Client ¶
type Client interface { // DialTCP connects to `raddr` over TCP though a Shadowsocks proxy. // `laddr` is a local bind address, a local address is automatically chosen if nil. // `raddr` has the form `host:port`, where `host` can be a domain name or IP address. DialTCP(laddr *net.TCPAddr, raddr string) (onet.DuplexConn, error) // ListenUDP relays UDP packets though a Shadowsocks proxy. // `laddr` is a local bind address, a local address is automatically chosen if nil. ListenUDP(laddr *net.UDPAddr) (net.PacketConn, error) // SetTCPSaltGenerator controls the SaltGenerator used for TCP upstream. // `salter` may be `nil`. // This method is not thread-safe. SetTCPSaltGenerator(ss.SaltGenerator) TCPFd() int UDPFd() int }
Client is a client for Shadowsocks TCP and UDP connections.