Documentation ¶
Index ¶
- type Associate
- func (sf *Associate) File() (f *os.File, err error)
- func (sf *Associate) ReadFrom(b []byte) (int, net.Addr, error)
- func (sf *Associate) ReadFromUDP(b []byte) (n int, addr *net.UDPAddr, err error)
- func (sf *Associate) ReadMsgUDP(b, oob []byte) (n, oobn, flags int, addr *net.UDPAddr, err error)
- func (sf *Associate) SetReadBuffer(bytes int) error
- func (sf *Associate) SetWriteBuffer(bytes int) error
- func (sf *Associate) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (n, oobn int, err error)
- func (sf *Associate) WriteTo(b []byte, addr net.Addr) (int, error)
- func (sf *Associate) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error)
- type Client
- func (sf *Client) Close() (err error)
- func (sf *Client) Dial(network, addr string) (net.Conn, error)
- func (sf *Client) DialTCP(network, addr string) (net.Conn, error)
- func (sf *Client) DialUDP(network string, laddr *net.UDPAddr, raddr string) (net.Conn, error)
- func (sf *Client) SetKeepAlive(keepalive bool) error
- func (sf *Client) SetKeepAlivePeriod(d time.Duration) error
- type Connect
- func (sf *Connect) CloseRead() error
- func (sf *Connect) CloseWrite() error
- func (sf *Connect) File() (f *os.File, err error)
- func (sf *Connect) ReadFrom(r io.Reader) (int64, error)
- func (sf *Connect) SetKeepAlive(keepalive bool) error
- func (sf *Connect) SetKeepAlivePeriod(d time.Duration) error
- func (sf *Connect) SetLinger(sec int) error
- func (sf *Connect) SetNoDelay(noDelay bool) error
- func (sf *Connect) SetReadBuffer(bytes int) error
- func (sf *Connect) SetWriteBuffer(bytes int) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Associate ¶
type Associate struct {
*Client
}
Associate implement sock5 associate command
func (*Associate) ReadFromUDP ¶
ReadFromUDP acts like ReadFrom but returns a UDPAddr.
func (*Associate) ReadMsgUDP ¶
ReadMsgUDP reads a message from c, copying the payload into b and the associated out-of-band data into oob.
func (*Associate) SetReadBuffer ¶
SetReadBuffer sets the size of the operating system's receive buffer associated with the connection.
func (*Associate) SetWriteBuffer ¶
SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection.
func (*Associate) WriteMsgUDP ¶
WriteMsgUDP writes a message to addr via c if c isn't connected, or to c's remote address if c is connected (in which case addr must be nil)
type Client ¶
type Client struct { // real server connection udp/tcp net.Conn // contains filtered or unexported fields }
Client is socks5 client.
func (*Client) Dial ¶
Dial connects to the address on the named network through proxy , with socks5 handshake.
func (*Client) DialTCP ¶
DialTCP connects to the address on the named network through proxy , with socks5 handshake.
func (*Client) DialUDP ¶
DialUDP connects to the address on the named network through proxy , with socks5 handshake.
func (*Client) SetKeepAlive ¶
SetKeepAlive sets whether the operating system should send keep-alive messages on the connection.
type Connect ¶
type Connect struct {
*Client
}
Connect implement sock5 connect command
func (*Connect) CloseRead ¶
CloseRead shuts down the reading side of the TCP connection. Most callers should just use Close.
func (*Connect) CloseWrite ¶
CloseWrite shuts down the writing side of the TCP connection. Most callers should just use Close.
func (*Connect) SetKeepAlive ¶
SetKeepAlive sets whether the operating system should send keep-alive messages on the connection.
func (*Connect) SetKeepAlivePeriod ¶
SetKeepAlivePeriod sets period between keep-alives.
func (*Connect) SetLinger ¶
SetLinger sets the behavior of Close on a connection which still has data waiting to be sent or to be acknowledged.
func (*Connect) SetNoDelay ¶
SetNoDelay controls whether the operating system should delay packet transmission in hopes of sending fewer packets (Nagle's algorithm). The default is true (no delay), meaning that data is sent as soon as possible after a Write.
func (*Connect) SetReadBuffer ¶
SetReadBuffer sets the size of the operating system's receive buffer associated with the connection.
func (*Connect) SetWriteBuffer ¶
SetWriteBuffer sets the size of the operating system's transmit buffer associated with the connection.
type Option ¶
type Option func(c *Client)
Option user's option of the client
func WithBufferPool ¶
func WithBufferPool(p bufferpool.BufPool) Option
WithBufferPool with buffer pool default: 32k