mirror of
https://github.com/fatedier/frp.git
synced 2026-05-15 08:05:49 -06:00
[GH-ISSUE #3850] frpc的HTTP代理能使用,socks5代理无法使用,socks5报错0x03或0x04 #3060
Labels
No labels
In Progress
WIP
WaitingForInfo
bug
doc
duplicate
easy
enhancement
future
help wanted
invalid
lifecycle/stale
need-issue-template
need-usage-help
no plan
proposal
pull-request
question
todo
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: github-starred/frp#3060
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @AdiEcho on GitHub (Dec 15, 2023).
Original GitHub issue: https://github.com/fatedier/frp/issues/3850
Bug Description
先说一下我的部署情况
frps 是双栈网络环境机器,frpc 部分双栈部分仅v4,frpc同时部署http代理和socks5代理
在几台机器上的http代理正常通网,但是socks5不通,使用socks5的时候报错0x03: Network unreachable或0x04: Host unreachable
这个现象在几台机器上必现,其他机器socks5和http代理均可用
在log中没有有用的信息,所以发到issue中看看有没有大佬知道是啥情况
frpc Version
0.53.0
frps Version
0.53.0
System Architecture
linux/amd64
Configurations
Logs
Steps to reproduce
正常部署
Affected area
@AdiEcho commented on GitHub (Dec 15, 2023):
经测试
访问目标为ip地址时,问题机器部署的socks5代理和http代理使用均正常
访问目标为域名地址时,仅http代理工作正常
应用方面使用doh实现解决了这个问题,但对其出现的原因还是不理解
@xqzr commented on GitHub (Dec 15, 2023):
IP 协议版本🤔
比如 frpc 没有 IPv6,但域名解析 得到 IPv6 地址,并且 使用它连接
@xqzr commented on GitHub (Dec 15, 2023):
socks5 代理 收到域名 时有可能,在本地解析
(结果可能被污染)http 代理 收到域名 时不会在 本地解析,而是 传递给 frpc 解析
@AdiEcho commented on GitHub (Dec 15, 2023):
太对了哥,就是这个原因
刚刚找了 纯v4/v6/双栈 的网站测试了一下
socks5 只能连接 纯v4 网站,纯v6/双栈 网站都无法使用,如issue报错
http 能连接 纯v4/双栈 网站,纯v6 则报错 dial tcp: lookup **** on 127.0.0.1:53: no such host
感谢老哥的解答
PS: 其实还是有点不明白,为什么会解析到v6地址,这样的话socks5也太脆弱了,双栈网站都无法连接
@xqzr commented on GitHub (Dec 15, 2023):
frpc 这边有 IPv6 能力吗?如果没有 socks5 客户端(浏览器)把 IPv6 地址 传递给 socks5 服务端(frpc),而 frpc 这边网络 没有 IPv6 能力,就出错了
@AdiEcho commented on GitHub (Dec 16, 2023):
出问题的frpc都没有v6地址
确实是socks5客户端的问题,客户端是双栈环境,通过限制仅v4连接也同样解决了这个问题了
顺便贴一下相关的python代码给有需要的朋友