export DialFunc

master
Dingjun 7 years ago
parent 1d2a1a1d6d
commit 1b11369965

@ -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

@ -34,7 +34,7 @@ byte | 0 | 1 | 2 | 3 | 4 | 5 | 6| 7 |
type socks4Conn struct { type socks4Conn struct {
serverConn net.Conn serverConn net.Conn
clientConn net.Conn clientConn net.Conn
dial dialFunc dial DialFunc
} }
func (s4 *socks4Conn) Serve() { func (s4 *socks4Conn) Serve() {

@ -56,7 +56,7 @@ type socks5Conn struct {
//addr string //addr string
clientConn net.Conn clientConn net.Conn
serverConn net.Conn serverConn net.Conn
dial dialFunc dial DialFunc
} }
func (s5 *socks5Conn) Serve() { func (s5 *socks5Conn) Serve() {

Loading…
Cancel
Save