|
|
@ -16,14 +16,15 @@ const (
|
|
|
|
addrTypeIPv6 = 0x04
|
|
|
|
addrTypeIPv6 = 0x04
|
|
|
|
)
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
type dialFunc func(network, addr string) (net.Conn, error)
|
|
|
|
// DialFunc the function dial to remote
|
|
|
|
|
|
|
|
type DialFunc func(network, addr string) (net.Conn, error)
|
|
|
|
|
|
|
|
|
|
|
|
// Conn present a client connection
|
|
|
|
// Conn present a client connection
|
|
|
|
type Conn struct {
|
|
|
|
type Conn struct {
|
|
|
|
net.Conn
|
|
|
|
net.Conn
|
|
|
|
// the function to dial to upstream server
|
|
|
|
// the function to dial to upstream server
|
|
|
|
// when nil, use net.Dial
|
|
|
|
// when nil, use net.Dial
|
|
|
|
Dial dialFunc
|
|
|
|
Dial DialFunc
|
|
|
|
// username for socks5 server
|
|
|
|
// username for socks5 server
|
|
|
|
Username string
|
|
|
|
Username string
|
|
|
|
// password
|
|
|
|
// password
|
|
|
|