goproxy icon indicating copy to clipboard operation
goproxy copied to clipboard

Can we support to use server side dns ?

Open jay763190097 opened this issue 2 years ago • 5 comments

Expected Behavior

curl https://www.github.com --socks5 8.218.12.92:6543 can return successfully

Current Behavior

(anaconda3-2020.11) jay@jay-PC:~/Node/simple-socks$ curl https://www.github.com --socks5 8.218.12.92:6543
curl: (35) OpenSSL SSL_connect: SSL_ERROR_SYSCALL in connection to www.github.com:443 
[root@iZj6caq81rcy1s8vj7cxx0Z home]# ./proxy   socks -t tcp -p "0.0.0.0:6543" --udp-port 0 --udp
2021/10/30 08:46:07.341494 INFO s5 udp on [::]:48031
2021/10/30 08:46:07.342167 INFO tcp socks proxy on [::]:6543
2021/10/30 08:46:13.195262 INFO ip 183.237.146.203 rate, current: 1/s, max: 20/s
2021/10/30 08:46:18.195487 WARN get out conn fail,dial tcp 192.30.253.112:443: i/o timeout

192.30.253.112 is not the correct IP. I guess it's using the client dns.

Possible Solution

use the server side dns.

Context (Environment)

  1. proxy version is : free_11.2
  2. system is : centos8

jay763190097 avatar Oct 30 '21 00:10 jay763190097

--socks5h option do that, it's curl feature.

snail007 avatar Oct 30 '21 07:10 snail007

what do you mean?

I tried to use --socks5h, But it seems not correct as bellow. image

[root@iZj6caq81rcy1s8vj7cxx0Z home]# ./proxy socks -t tcp -p "0.0.0.0:6543" --udp-port 0 --udp
2021/11/01 23:35:45.286308 INFO s5 udp on [::]:41307
2021/11/01 23:35:45.286959 INFO tcp socks proxy on [::]:6543
2021/11/01 23:36:03.881455 INFO ip 183.237.146.203 rate, current: 1/s, max: 20/s
2021/11/01 23:36:03.930786 INFO use parent false : 163.177.151.110:443
2021/11/01 23:36:03.930823 INFO conn 183.237.146.203:50178 - 163.177.151.110:443 connected
2021/11/01 23:36:04.263902 INFO conn 183.237.146.203:50178 - 163.177.151.110:443 released
2021/11/01 23:38:45.424633 INFO ip 183.237.146.203 rate, current: 1/s, max: 20/s
2021/11/01 23:38:50.424829 WARN get out conn fail,dial tcp 172.217.17.36:443: i/o timeout

my suggestion is to support the server side dns. because ip(172.217.17.36) of google.com is not correct, my server can not reach to.

another question is when I'm using the shadowsocks to connect the goproxy, it's constantly throwing version issue.

2021/11/01 23:43:14.776901 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported
2021/11/01 23:43:14.942568 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported
2021/11/01 23:43:14.943546 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported
2021/11/01 23:43:15.139555 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported
2021/11/01 23:43:17.955261 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported
2021/11/01 23:43:18.983782 WARN handshake fail, ERR: new methods request fail,ERR: socks version not supported

jay763190097 avatar Nov 01 '21 15:11 jay763190097

my computer

(anaconda3-2020.11) jay@jay-PC:~$ ping www.google.com
PING www.google.com (172.217.17.36) 56(84) bytes of data.
^C
--- www.google.com ping statistics ---
3 packets transmitted, 0 received, 100% packet loss, time 54ms

172.217.17.36 is parsed by the dns in my local env, So I guess that is place where happened.

my server

[root@iZj6caq81rcy1s8vj7cxx0Z home]# ping www.google.com
PING www.google.com (216.58.200.68) 56(84) bytes of data.
64 bytes from hkg07s30-in-f4.1e100.net (216.58.200.68): icmp_seq=1 ttl=58 time=1.85 ms
64 bytes from hkg07s30-in-f4.1e100.net (216.58.200.68): icmp_seq=2 ttl=58 time=1.87 ms
64 bytes from hkg07s30-in-f4.1e100.net (216.58.200.68): icmp_seq=3 ttl=58 time=1.87 ms
64 bytes from hkg07s30-in-f4.1e100.net (216.58.200.68): icmp_seq=4 ttl=58 time=1.88 ms
64 bytes from hkg07s30-in-f4.1e100.net (216.58.200.68): icmp_seq=5 ttl=58 time=1.87 ms
^C
--- www.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 12ms
rtt min/avg/max/mdev = 1.850/1.868/1.876/0.048 ms

jay763190097 avatar Nov 01 '21 16:11 jay763190097

curl -x socks5h://foo.com: port URL

snail007 avatar Nov 01 '21 23:11 snail007

can not work.

root@iZj6caq81rcy1s8vj7cxx0Z ~]# curl -X socks5h://127.0.0.1:6543 https://www.g

oogle.com

curl: (92) HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

[root@iZj6caq81rcy1s8vj7cxx0Z ~]#


jay763190097 avatar Nov 03 '21 02:11 jay763190097