export DialFunc

master
Dingjun 7 years ago
parent 1d2a1a1d6d
commit 1b11369965

@ -16,14 +16,15 @@ const (
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
type Conn struct {
net.Conn
// the function to dial to upstream server
// when nil, use net.Dial
Dial dialFunc
Dial DialFunc
// username for socks5 server
Username string
// password

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

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

Loading…
Cancel
Save