xjasonlyu / tun2socks

tun2socks - powered by gVisor TCP/IP stack
https://github.com/xjasonlyu/tun2socks/wiki
GNU General Public License v3.0
2.85k stars 404 forks source link

[Feature] the client should be given a TCP handshake failure (RST) response when socks5 proxy returns "remoteAddr connection refuse" (0x05) #234

Closed 0990 closed 1 year ago

0990 commented 1 year ago

Description

以下是我在其它项目的提问(Is "really" transparent proxy),发现这个项目也有这个问题: 遇到一个情况,当dns返回多个ip(A和B),正常情况下,当A不可访问(connection refused),这时会再尝试B。当使用透明代理后ipt2socks,猜测工作在TCP level层,已经三次握手了,只会显示A(unable to establish ssl connection),不再尝试B了。具体现象就是透明代理机器上wget下载某张图片l时有时能打开(访问了B),有时打不开(访问了A),但在socks server服务器上,使用wget 命令下载这张图片时,当访问A不成功时显示connection refused会再尝试B,一定会成功

Is this feature related to a specific bug?

No response

Do you have a specific solution in mind?

要等待远程代理连接创建成功后,再和客户端完成三次握手,我fork了你的代码,改了下,目前测试解决了这个问题,稍后pull request

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days