package socks

Import Path
	golang.org/x/net/internal/socks (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package

Involved Source Files client.go Package socks provides a SOCKS version 5 client implementation. SOCKS protocol version 5 is defined in RFC 1928. Username/Password authentication for SOCKS version 5 is defined in RFC 1929.
Package-Level Type Names (total 7, all are exported)
/* sort exporteds by: | */
An Addr represents a SOCKS-specific address. Either Name or IP is used exclusively. IP net.IP // fully-qualified domain name Port int (*Addr) Network() string (*Addr) String() string *Addr : fmt.Stringer *Addr : net.Addr
An AuthMethod represents a SOCKS authentication method. func (*UsernamePassword).Authenticate(ctx context.Context, rw io.ReadWriter, auth AuthMethod) error const AuthMethodNoAcceptableMethods const AuthMethodNotRequired const AuthMethodUsernamePassword
A Command represents a SOCKS command. ( Command) String() string Command : fmt.Stringer const CmdConnect
A Conn represents a forward proxy connection. Conn net.Conn BoundAddr returns the address assigned by the proxy server for connecting to the command target address from the proxy server. Close closes the connection. Any blocked Read or Write operations will be unblocked and return errors. LocalAddr returns the local network address, if known. Read reads data from the connection. Read can be made to time out and return an error after a fixed time limit; see SetDeadline and SetReadDeadline. RemoteAddr returns the remote network address, if known. SetDeadline sets the read and write deadlines associated with the connection. It is equivalent to calling both SetReadDeadline and SetWriteDeadline. A deadline is an absolute time after which I/O operations fail instead of blocking. The deadline applies to all future and pending I/O, not just the immediately following call to Read or Write. After a deadline has been exceeded, the connection can be refreshed by setting a deadline in the future. If the deadline is exceeded a call to Read or Write or to other I/O methods will return an error that wraps os.ErrDeadlineExceeded. This can be tested using errors.Is(err, os.ErrDeadlineExceeded). The error's Timeout method will return true, but note that there are other possible errors for which the Timeout method will return true even if the deadline has not been exceeded. An idle timeout can be implemented by repeatedly extending the deadline after successful Read or Write calls. A zero value for t means I/O operations will not time out. SetReadDeadline sets the deadline for future Read calls and any currently-blocked Read call. A zero value for t means Read will not time out. SetWriteDeadline sets the deadline for future Write calls and any currently-blocked Write call. Even if write times out, it may return n > 0, indicating that some of the data was successfully written. A zero value for t means Write will not time out. Write writes data to the connection. Write can be made to time out and return an error after a fixed time limit; see SetDeadline and SetWriteDeadline. Conn : internal/bisect.Writer Conn : io.Closer Conn : io.ReadCloser Conn : io.Reader Conn : io.ReadWriteCloser Conn : io.ReadWriter Conn : io.WriteCloser Conn : io.Writer Conn : net.Conn
A Dialer holds SOCKS-specific options. AuthMethods specifies the list of request authentication methods. If empty, SOCKS client requests only AuthMethodNotRequired. Authenticate specifies the optional authentication function. It must be non-nil when AuthMethods is not empty. It must return an error when the authentication is failed. ProxyDial specifies the optional dial function for establishing the transport connection. 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. 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. 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. *Dialer : golang.org/x/net/proxy.ContextDialer *Dialer : golang.org/x/net/proxy.Dialer func NewDialer(network, address string) *Dialer
A Reply represents a SOCKS command reply code. ( Reply) String() string Reply : fmt.Stringer const StatusSucceeded
UsernamePassword are the credentials for the username/password authentication method. Password string Username string Authenticate authenticates a pair of username and password with the proxy server.
Package-Level Functions (total 2, in which 1 is exported)
NewDialer returns a new Dialer that dials through the provided proxy server's network and address.
Package-Level Variables (total 2, neither is exported)
Package-Level Constants (total 12, in which 9 are exported)
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.
Wire protocol constants.