[GH-ISSUE #633] 安卓 Android 的frpc在配置文件中使用server_addr = 域名,不能工作。望开发者亲测。 #492

Closed
opened 2026-05-05 12:19:12 -06:00 by gitea-mirror · 12 comments
Owner

Originally created by @zhoujun2 on GitHub (Feb 4, 2018).
Original GitHub issue: https://github.com/fatedier/frp/issues/633

Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly.
(为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。)
安卓 Android 的frpc在配置文件中使用server_addr = 域名,不能工作。(直接填写IP正常)
所以安卓 所有版本frpc都有这个问题
命令行报错如下
2018/01/01 00:00:00 [w] [control.go:109] login to server faied: lookup www.domain.com on [::1]:53: read udp [::1]:39942->[::1]:53: read: connection refused
lookup www.domain.com on [::1]:53: read udp [::1]:39942->[::1]:53: read: connection refused
在很多安卓手机上做了测试,权限配置正常,DNS配置正常
你别说换成IP,有的环境IP总变,必须用域名
Use the commands below to provide key information from your environment:
You do NOT have to include this information if this is a FEATURE REQUEST
frps.ini 内容如下
server_addr = www.domain.com
server_port = 7000
type = tcp
local_ip = 127.0.0.1
local_port = 22

What version of frp are you using (./frpc -v or ./frps -v)?
0.16.0 0.15.1 0.14.0

What operating system and processor architecture are you using (go env)?
Android linux

Originally created by @zhoujun2 on GitHub (Feb 4, 2018). Original GitHub issue: https://github.com/fatedier/frp/issues/633 Issue is only used for submiting bug report and documents typo. If there are same issues or answers can be found in documents, we will close it directly. (为了节约时间,提高处理问题的效率,不按照格式填写的 issue 将会直接关闭。) 安卓 Android 的frpc在配置文件中使用server_addr = 域名,不能工作。(直接填写IP正常) 所以安卓 所有版本frpc都有这个问题 命令行报错如下 2018/01/01 00:00:00 [w] [control.go:109] login to server faied: lookup www.domain.com on [::1]:53: read udp [::1]:39942->[::1]:53: read: connection refused lookup www.domain.com on [::1]:53: read udp [::1]:39942->[::1]:53: read: connection refused 在很多安卓手机上做了测试,权限配置正常,DNS配置正常 你别说换成IP,有的环境IP总变,必须用域名 Use the commands below to provide key information from your environment: You do NOT have to include this information if this is a FEATURE REQUEST frps.ini 内容如下 server_addr = www.domain.com server_port = 7000 type = tcp local_ip = 127.0.0.1 local_port = 22 **What version of frp are you using (./frpc -v or ./frps -v)?** 0.16.0 0.15.1 0.14.0 **What operating system and processor architecture are you using (`go env`)?** Android linux
Author
Owner

@yyingc commented on GitHub (Feb 4, 2018):

server_addr = www.domain.com
换成IP

<!-- gh-comment-id:362906290 --> @yyingc commented on GitHub (Feb 4, 2018): server_addr = www.domain.com 换成IP
Author
Owner

@Sak94664 commented on GitHub (Feb 4, 2018):

也遇到了类似的问题。
但是自己使用termux编译不会出现该问题。
亲测正常使用。
Edit:
(配置中填写的是域名)

<!-- gh-comment-id:362906363 --> @Sak94664 commented on GitHub (Feb 4, 2018): 也遇到了类似的问题。 但是自己使用termux编译不会出现该问题。 亲测正常使用。 Edit: (配置中填写的是域名)
Author
Owner

@Droid-MAX commented on GitHub (Feb 5, 2018):

难道是因为官方提供的预编译文件是静态编译的原因?

<!-- gh-comment-id:362986805 --> @Droid-MAX commented on GitHub (Feb 5, 2018): 难道是因为官方提供的预编译文件是静态编译的原因?
Author
Owner

@nirui commented on GitHub (Feb 6, 2018):

看日志是无法连接到53端口。你可以试试看用在你运行frp的环境下运行nslookup或者dig,看这两个命令是否能成功得到返回。

因为从代码来看,域名解析的部分直接调用了 net.ResolveTCPAddr(如果是TCP直接连接的话),不应该会有这样的问题。

<!-- gh-comment-id:363323220 --> @nirui commented on GitHub (Feb 6, 2018): 看日志是无法连接到53端口。你可以试试看用在你运行frp的环境下运行nslookup或者dig,看这两个命令是否能成功得到返回。 因为从[代码](https://github.com/fatedier/frp/blob/456ce09061bea765f511983b835faf6f6b44c91d/utils/net/tcp.go#L105)来看,域名解析的部分直接调用了 `net.ResolveTCPAddr`(如果是TCP直接连接的话),不应该会有这样的问题。
Author
Owner

@Sak94664 commented on GitHub (Feb 6, 2018):

@reinit 可以啊。
同样的环境,官方编译的不行,自己运行却可以。

<!-- gh-comment-id:363336769 --> @Sak94664 commented on GitHub (Feb 6, 2018): @reinit 可以啊。 同样的环境,官方编译的不行,自己运行却可以。
Author
Owner

@nirui commented on GitHub (Feb 6, 2018):

@Sak94664 你可以再试试看自己编译一下,用命令行:CGO_ENABLED=0 go build -o ./frpc ./cmd/frpc看看编译出的二进制文件是不是能重现问题。

这大概是唯一一个会导致编译出的文件Resolver行为不同的地方。

<!-- gh-comment-id:363338478 --> @nirui commented on GitHub (Feb 6, 2018): @Sak94664 你可以再试试看自己编译一下,用命令行:`CGO_ENABLED=0 go build -o ./frpc ./cmd/frpc`看看编译出的二进制文件是不是能重现问题。 这大概是唯一一个会导致编译出的文件Resolver行为不同的地方。
Author
Owner

@Sak94664 commented on GitHub (Feb 6, 2018):

@reinit 不能重现。
(自己编译的可以运行,官方编译的不能运行)
环境是Termux.
nslookup无错误。

<!-- gh-comment-id:363342795 --> @Sak94664 commented on GitHub (Feb 6, 2018): @reinit 不能重现。 (自己编译的可以运行,官方编译的不能运行) 环境是Termux. nslookup无错误。
Author
Owner

@nirui commented on GitHub (Feb 6, 2018):

@Sak94664 Termux里的Go编译器是什么版本的?以及程序在什么样的权限下运行?

又看了一次代码,包括KCP的那部分以及你在dnscrypt-proxy项目下的。个人觉得这个问题跟frp没什么关系,最好看看Termux。

<!-- gh-comment-id:363348527 --> @nirui commented on GitHub (Feb 6, 2018): @Sak94664 Termux里的Go编译器是什么版本的?以及程序在什么样的权限下运行? 又看了一次代码,包括KCP的那部分以及你在dnscrypt-proxy项目下的。个人觉得这个问题跟frp没什么关系,最好看看Termux。
Author
Owner

@Sak94664 commented on GitHub (Feb 6, 2018):

@reinit go版本1.9.2 ,程序无root运行。

<!-- gh-comment-id:363365854 --> @Sak94664 commented on GitHub (Feb 6, 2018): @reinit go版本1.9.2 ,程序无root运行。
Author
Owner

@zhoujun2 commented on GitHub (Feb 8, 2018):

不会编译arm程序,Termux.要求安卓5.0,不是所有人都有的。官方能在安卓上面编译一个吗

<!-- gh-comment-id:364042019 --> @zhoujun2 commented on GitHub (Feb 8, 2018): 不会编译arm程序,Termux.要求安卓5.0,不是所有人都有的。官方能在安卓上面编译一个吗
Author
Owner

@fatedier commented on GitHub (Feb 26, 2018):

目前没有提供 android 环境编译好的程序,建议可以根据上述其他人编译的经验自行编译。

<!-- gh-comment-id:368518106 --> @fatedier commented on GitHub (Feb 26, 2018): 目前没有提供 android 环境编译好的程序,建议可以根据上述其他人编译的经验自行编译。
Author
Owner

@iineva commented on GitHub (Apr 9, 2018):

希望重新探讨解决此问题,我对此做了研究,开了个新的issue: #700

<!-- gh-comment-id:379767814 --> @iineva commented on GitHub (Apr 9, 2018): 希望重新探讨解决此问题,我对此做了研究,开了个新的issue: #700
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: github-starred/frp#492
No description provided.