Xray-core icon indicating copy to clipboard operation
Xray-core copied to clipboard

无法通过xray使用部分SSH软件连接目标主机

Open islercn opened this issue 1 month ago • 13 comments

完整性要求

  • [X] 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • [X] 我搜索了issues,没有发现已提出的类似问题。

版本

1.8.15

描述

有一个带密码的上游https代理,我把它转成了透明代理,用iptables转发。在测试中,上网、远程桌面什么的都没问题,但是用xshell之类的软件通过ssh连代理后的服务器,直接没反应(提示连接,然后就卡在那了),且: 1.kill掉xray,起ss的透明代理(其他都不变),秒连(意味着iptables转发没有问题) 2.用putty,秒连;用MobaXterm,连不上,和xshell一样(ss下可连) 3.将这个https代理用goproxy转成socks5,然后xshell下ssh设置这个socks5代理,秒连,但是xray连socks5也不行

防火墙配置: iptables -t nat -A work -p tcp -m set --match-set worklist dst -j REDIRECT --to-ports 123

抓包的数据上看,除了xshell的包长度超过1500,putty没超,别的地方似乎没有任何区别了。

也可以看goproxy的这个issue

1 2

重现方式

把上游https代理转成透明代理,xshell等软件无法通过代理连接目标服务器(SSH)

客户端配置

{ "log": { "error": "/root/proxy/xray/error.log", "loglevel": "debug" }, "inbounds": [ { "port": 321, "protocol": "socks", "settings": { "udp": true } }, { "port": 123, "protocol": "dokodemo-door", "sniffing": { "enabled": true, "destOverride": ["http", "tls"] }, "settings": { "network": "tcp,udp", "followRedirect": true }, "streamSettings": { "sockopt": { "tproxy": "redirect" } } } ], "outbounds": [ { "protocol": "http", "settings": { "servers": [ { "address": "proxy.com", "port": 12345, "users": [ { "user": "username", "pass": "password" } ] } ] }, "streamSettings": { "security": "tls", "tlsSettings": { "allowInsecure": false } } } ] }

服务端配置

上级是https代理,无配置

客户端日志

只记录到这么多,xxx.com和10.1.1.2对应同一台机器):

透明代理日志: 2024/06/20 12:38:01 [Debug] [1299392023] proxy/dokodemo: processing connection from: 192.168.11.101:63925 2024/06/20 12:38:01 [Info] [1299392023] proxy/dokodemo: received request for 192.168.11.101:63925 2024/06/20 12:38:02 [Info] [1299392023] app/dispatcher: default route for tcp:10.1.1.2:22

SOCKS代理日志: 2024/06/20 12:25:43 [Info] [1352458977] proxy/socks: TCP Connect request to tcp:xxx.com:22 2024/06/20 12:25:43 [Info] [1352458977] app/dispatcher: default route for tcp:xxx.com:22

服务端日志

上级是https代理,无日志

islercn avatar Jun 20 '24 12:06 islercn