From 1b113699653a7a38e2f58e4812481d942a6f233e Mon Sep 17 00:00:00 2001 From: Dingjun Date: Fri, 29 Sep 2017 14:23:00 +0800 Subject: [PATCH] export DialFunc --- socks.go | 5 +++-- socks4.go | 2 +- socks5.go | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/socks.go b/socks.go index 3f7c76c..1f9a625 100755 --- a/socks.go +++ b/socks.go @@ -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 diff --git a/socks4.go b/socks4.go index 7472b90..6e9b1de 100755 --- a/socks4.go +++ b/socks4.go @@ -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() { diff --git a/socks5.go b/socks5.go index 13f8ef1..0535555 100755 --- a/socks5.go +++ b/socks5.go @@ -56,7 +56,7 @@ type socks5Conn struct { //addr string clientConn net.Conn serverConn net.Conn - dial dialFunc + dial DialFunc } func (s5 *socks5Conn) Serve() {