type Command … func (cmd Command) String() string { … } type AuthMethod … type Reply … func (code Reply) String() string { … } const Version5 … const AddrTypeIPv4 … const AddrTypeFQDN … const AddrTypeIPv6 … const CmdConnect … const cmdBind … const AuthMethodNotRequired … const AuthMethodUsernamePassword … const AuthMethodNoAcceptableMethods … const StatusSucceeded … type Addr … func (a *Addr) Network() string { … } func (a *Addr) String() string { … } type Conn … // BoundAddr returns the address assigned by the proxy server for // connecting to the command target address from the proxy server. func (c *Conn) BoundAddr() net.Addr { … } type Dialer … // DialContext connects to the provided address on the provided // network. // // The returned error value may be a net.OpError. When the Op field of // net.OpError contains "socks", the Source field contains a proxy // server address and the Addr field contains a command target // address. // // See func Dial of the net package of standard library for a // description of the network and address parameters. func (d *Dialer) DialContext(ctx context.Context, network, address string) (net.Conn, error) { … } // DialWithConn initiates a connection from SOCKS server to the target // network and address using the connection c that is already // connected to the SOCKS server. // // It returns the connection's local address assigned by the SOCKS // server. func (d *Dialer) DialWithConn(ctx context.Context, c net.Conn, network, address string) (net.Addr, error) { … } // Dial connects to the provided address on the provided network. // // Unlike DialContext, it returns a raw transport connection instead // of a forward proxy connection. // // Deprecated: Use DialContext or DialWithConn instead. func (d *Dialer) Dial(network, address string) (net.Conn, error) { … } func (d *Dialer) validateTarget(network, address string) error { … } func (d *Dialer) pathAddrs(address string) (proxy, dst net.Addr, err error) { … } // NewDialer returns a new Dialer that dials through the provided // proxy server's network and address. func NewDialer(network, address string) *Dialer { … } const authUsernamePasswordVersion … const authStatusSucceeded … type UsernamePassword … // Authenticate authenticates a pair of username and password with the // proxy server. func (up *UsernamePassword) Authenticate(ctx context.Context, rw io.ReadWriter, auth AuthMethod) error { … }