[GH-ISSUE #453] Can we support to use server side dns ? #359

Open
opened 2026-02-27 23:16:37 +03:00 by kerem · 5 comments
Owner

Originally created by @jay763190097 on GitHub (Oct 30, 2021).
Original GitHub issue: https://github.com/snail007/goproxy/issues/453

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
Originally created by @jay763190097 on GitHub (Oct 30, 2021). Original GitHub issue: https://github.com/snail007/goproxy/issues/453 <!--- Provide a general summary of the issue in the Title above --> ## Expected Behavior <!--- Tell us what should happen --> curl https://www.github.com --socks5 8.218.12.92:6543 can return successfully ## Current Behavior <!--- Tell us what happens instead of the expected 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 <!--- Not obligatory, but suggest a fix/reason for the bug, --> use the server side dns. ## Context (Environment) <!--- How has this issue affected you? What are you trying to accomplish? --> <!--- Providing context helps us come up with a solution that is most useful in the real world --> 1. proxy version is : free_11.2 1. system is : centos8
Author
Owner

@snail007 commented on GitHub (Oct 30, 2021):

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

<!-- gh-comment-id:955163353 --> @snail007 commented on GitHub (Oct 30, 2021): --socks5h option do that, it's curl feature.
Author
Owner

@jay763190097 commented on GitHub (Nov 1, 2021):

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
<!-- gh-comment-id:956346155 --> @jay763190097 commented on GitHub (Nov 1, 2021): what do you mean? I tried to use --socks5h, But it seems not correct as bellow. ![image](https://user-images.githubusercontent.com/16317178/139698970-0e84215f-c84b-42f1-8aab-370457ff36d0.png) ``` [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 ```
Author
Owner

@jay763190097 commented on GitHub (Nov 1, 2021):

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
<!-- gh-comment-id:956382456 --> @jay763190097 commented on GitHub (Nov 1, 2021): 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 ```
Author
Owner

@snail007 commented on GitHub (Nov 1, 2021):

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

<!-- gh-comment-id:956853257 --> @snail007 commented on GitHub (Nov 1, 2021): curl -x socks5h://foo.com: port URL
Author
Owner

@jay763190097 commented on GitHub (Nov 3, 2021):

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 ~]#


<!-- gh-comment-id:958603479 --> @jay763190097 commented on GitHub (Nov 3, 2021): 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 ~]# ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/goproxy#359
No description provided.