Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用luci或service启动ua3f无法正常工作 #13

Open
Haocen2004 opened this issue Jun 6, 2024 · 17 comments
Open

使用luci或service启动ua3f无法正常工作 #13

Haocen2004 opened this issue Jun 6, 2024 · 17 comments

Comments

@Haocen2004
Copy link

RT 使用luci启动时日志显示偶尔有链接 但打不开国内网站
使用了ua3f-global-enhance.yaml配置
使用service启动也是无法打开国内网站 日志差不多

[2024-06-06 15:27:44][INFO]: UA3F v0.4.0
[2024-06-06 15:27:44][INFO]: Port: 1080
[2024-06-06 15:27:44][INFO]: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
[2024-06-06 15:27:44][INFO]: Log level: debug
[2024-06-06 15:27:44][INFO]: Listen on 127.0.0.1:1080
[2024-06-06 15:27:44][DEBUG]: Accept 127.0.0.1:54882
[2024-06-06 15:27:44][DEBUG]: Accept 127.0.0.1:54890
[2024-06-06 15:27:44][DEBUG]: Connecting www.bilibili.com:443
[2024-06-06 15:27:44][DEBUG]: Connecting www.bilibili.com:443
[2024-06-06 15:27:44][DEBUG]: Accept 127.0.0.1:54896
[2024-06-06 15:27:44][DEBUG]: Connecting i0.hdslb.com:443
[2024-06-06 15:27:44][DEBUG]: Accept 127.0.0.1:54900
[2024-06-06 15:27:44][DEBUG]: Connecting www.bilibili.com:443
[2024-06-06 15:27:44][DEBUG]: Accept 127.0.0.1:54910
[2024-06-06 15:27:44][DEBUG]: Connecting client.wns.windows.com:443

在切换至ssh链接并手动执行sudo -u nobody /usr/bin/ua3f后 可以正常使用并访问国内网站

root@N1:~# ua3f -l debug -f "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36"
[2024-06-06 15:30:15][INFO]: UA3F v0.4.0
[2024-06-06 15:30:15][INFO]: Port: 1080
[2024-06-06 15:30:15][INFO]: User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36
[2024-06-06 15:30:15][INFO]: Log level: debug
[2024-06-06 15:30:15][INFO]: Listen on 127.0.0.1:1080
[2024-06-06 15:30:15][DEBUG]: Accept 127.0.0.1:37152
[2024-06-06 15:30:15][DEBUG]: Connecting 58.83.177.124:1883
[2024-06-06 15:30:15][DEBUG]: Connected 58.83.177.124:1883
[2024-06-06 15:30:15][DEBUG]: Accept 127.0.0.1:37162
[2024-06-06 15:30:15][DEBUG]: Connecting www.baidu.com:443
[2024-06-06 15:30:15][DEBUG]: Connected www.baidu.com:443
[2024-06-06 15:30:15][DEBUG]: Accept 127.0.0.1:37170
[2024-06-06 15:30:15][DEBUG]: Connecting api2.mina.mi.com:443
[2024-06-06 15:30:15][DEBUG]: Connected api2.mina.mi.com:443
[2024-06-06 15:30:16][DEBUG]: Not HTTP, Hint: [22 3 1 2 0 1 0], Add LRU Relay Cache: www.baidu.com:443, Cache Len: 1
[2024-06-06 15:30:16][DEBUG]: Not HTTP, Hint: [22 3 1 2 0 1 0], Add LRU Relay Cache: api2.mina.mi.com:443, Cache Len: 2
[2024-06-06 15:30:16][DEBUG]: Accept 127.0.0.1:37186
[2024-06-06 15:30:16][DEBUG]: Connecting api2.mina.mi.com:443
[2024-06-06 15:30:16][DEBUG]: Connected api2.mina.mi.com:443
[2024-06-06 15:30:16][DEBUG]: Hit LRU Relay Cache: api2.mina.mi.com:443
[2024-06-06 15:30:18][DEBUG]: Accept 127.0.0.1:57112
[2024-06-06 15:30:18][DEBUG]: Connecting 59.82.122.57:443
[2024-06-06 15:30:18][DEBUG]: Connected 59.82.122.57:443
[2024-06-06 15:30:18][DEBUG]: Accept 127.0.0.1:57116
[2024-06-06 15:30:18][DEBUG]: Connecting 111.206.203.5:443
[2024-06-06 15:30:18][DEBUG]: Connected 111.206.203.5:443
[2024-06-06 15:30:18][DEBUG]: Accept 127.0.0.1:57124
[2024-06-06 15:30:18][DEBUG]: Accept 127.0.0.1:57136
[2024-06-06 15:30:18][DEBUG]: Connecting 119.147.175.28:443
[2024-06-06 15:30:18][DEBUG]: Connected 119.147.175.28:443
[2024-06-06 15:30:18][DEBUG]: Connecting 119.147.175.28:443
[2024-06-06 15:30:18][DEBUG]: Connected 119.147.175.28:443
[2024-06-06 15:30:18][DEBUG]: Accept 127.0.0.1:57138
[2024-06-06 15:30:18][DEBUG]: Connecting api2.mina.mi.com:443
[2024-06-06 15:30:18][DEBUG]: Connected api2.mina.mi.com:443
[2024-06-06 15:30:18][DEBUG]: Hit LRU Relay Cache: api2.mina.mi.com:443
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57152
[2024-06-06 15:30:19][DEBUG]: Connecting api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Connected api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57166
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57176
[2024-06-06 15:30:19][DEBUG]: Connecting store.heytapimage.com:443
[2024-06-06 15:30:19][DEBUG]: Connecting store.heytapimage.com:443
[2024-06-06 15:30:19][DEBUG]: Connected store.heytapimage.com:443
[2024-06-06 15:30:19][DEBUG]: Connected store.heytapimage.com:443
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57186
[2024-06-06 15:30:19][DEBUG]: Connecting api-cn.open.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Connected api-cn.open.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57198
[2024-06-06 15:30:19][DEBUG]: Connecting mdp-usertrace-cn.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Connected mdp-usertrace-cn.heytapmobi.com:443
[2024-06-06 15:30:19][DEBUG]: Accept 127.0.0.1:57206
[2024-06-06 15:30:19][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:19][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Not HTTP, Hint: [22 3 1 1 96 1 0], Add LRU Relay Cache: interface.music.163.com:443, Cache Len: 3
[2024-06-06 15:30:20][DEBUG]: Accept 127.0.0.1:57218
[2024-06-06 15:30:20][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Accept 127.0.0.1:57228
[2024-06-06 15:30:20][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:20][DEBUG]: Accept 127.0.0.1:57242
[2024-06-06 15:30:20][DEBUG]: Connecting broker.mina.mi.com:443
[2024-06-06 15:30:20][DEBUG]: Connected broker.mina.mi.com:443
[2024-06-06 15:30:20][DEBUG]: Not HTTP, Hint: [22 3 1 2 0 1 0], Add LRU Relay Cache: broker.mina.mi.com:443, Cache Len: 4
[2024-06-06 15:30:20][DEBUG]: Accept 127.0.0.1:57244
[2024-06-06 15:30:20][DEBUG]: Connecting api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:20][DEBUG]: Accept 127.0.0.1:57258
[2024-06-06 15:30:20][DEBUG]: Connected api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:20][DEBUG]: Connecting api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:20][DEBUG]: Connected api-cn.cdo.heytapmobi.com:443
[2024-06-06 15:30:21][DEBUG]: Accept 127.0.0.1:57264
[2024-06-06 15:30:21][DEBUG]: Connecting www.bilibili.com:443
[2024-06-06 15:30:21][DEBUG]: Connected www.bilibili.com:443
[2024-06-06 15:30:21][DEBUG]: Accept 127.0.0.1:57276
[2024-06-06 15:30:21][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:21][DEBUG]: Accept 127.0.0.1:57288
[2024-06-06 15:30:21][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:21][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:21][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:21][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:21][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57304
[2024-06-06 15:30:22][DEBUG]: Connecting 59.82.113.219:80
[2024-06-06 15:30:22][DEBUG]: Connected 59.82.113.219:80
[2024-06-06 15:30:22][DEBUG]: [59.82.113.219:80][127.0.0.1:57304] Hit User-Agent: Dalvik/2.1.0 (Linux; U; Android 13; PENM00 Build/TP1A.220905.001)
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57306
[2024-06-06 15:30:22][DEBUG]: Connecting i0.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57312
[2024-06-06 15:30:22][DEBUG]: Connecting s1.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: Connected i0.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: Connected s1.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: [59.82.113.219:80][127.0.0.1:57304] read closed in next phase: read tcp 127.0.0.1:1080->127.0.0.1:57304: use of closed network connection
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57318
[2024-06-06 15:30:22][DEBUG]: Connecting api.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connected api.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57320
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57332
[2024-06-06 15:30:22][DEBUG]: Connecting api.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connecting s1.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: Connected api.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connected s1.hdslb.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57346
[2024-06-06 15:30:22][DEBUG]: Connecting passport.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connected passport.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57352
[2024-06-06 15:30:22][DEBUG]: Connecting cm.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connected cm.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Accept 127.0.0.1:57364
[2024-06-06 15:30:22][DEBUG]: Connecting passport.bilibili.com:443
[2024-06-06 15:30:22][DEBUG]: Connected passport.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Accept 127.0.0.1:57372
[2024-06-06 15:30:23][DEBUG]: Connecting cm.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Accept 127.0.0.1:57386
[2024-06-06 15:30:23][DEBUG]: Connecting api.vc.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Connected cm.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Connected api.vc.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Accept 127.0.0.1:57398
[2024-06-06 15:30:23][DEBUG]: Connecting api.live.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Connected api.live.bilibili.com:443
[2024-06-06 15:30:23][DEBUG]: Accept 127.0.0.1:57404
[2024-06-06 15:30:23][DEBUG]: Connecting i0.hdslb.com:443
[2024-06-06 15:30:23][DEBUG]: Connected i0.hdslb.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57416
[2024-06-06 15:30:25][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57414
[2024-06-06 15:30:25][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57426
[2024-06-06 15:30:25][DEBUG]: Connecting ac.dun.163.com:443
[2024-06-06 15:30:25][DEBUG]: Connected ac.dun.163.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57436
[2024-06-06 15:30:25][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57438
[2024-06-06 15:30:25][DEBUG]: Connecting interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Connected interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Hit LRU Relay Cache: interface.music.163.com:443
[2024-06-06 15:30:25][DEBUG]: Accept 127.0.0.1:57442
[2024-06-06 15:30:25][DEBUG]: Connecting client.wns.windows.com:443
[2024-06-06 15:30:25][DEBUG]: Connected client.wns.windows.com:443
[2024-06-06 15:30:27][DEBUG]: Accept 127.0.0.1:57450
[2024-06-06 15:30:27][DEBUG]: Connecting clientlog.music.163.com:80
[2024-06-06 15:30:27][DEBUG]: Connected clientlog.music.163.com:80
[2024-06-06 15:30:27][DEBUG]: [clientlog.music.163.com:80][127.0.0.1:57450] Hit User-Agent: 
[2024-06-06 15:30:32][DEBUG]: Accept 127.0.0.1:44238
[2024-06-06 15:30:32][DEBUG]: Connecting securepubads.g.doubleclick.net:443
[2024-06-06 15:30:32][DEBUG]: Connected securepubads.g.doubleclick.net:443
[2024-06-06 15:30:46][DEBUG]: Accept 127.0.0.1:49408
[2024-06-06 15:30:46][DEBUG]: Connecting cm.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: Connected cm.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: [cm.bilibili.com:80][127.0.0.1:49408] Hit User-Agent: SogouIme
[2024-06-06 15:30:46][DEBUG]: Accept 127.0.0.1:49410
[2024-06-06 15:30:46][DEBUG]: Connecting api.vc.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: Connected api.vc.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: [api.vc.bilibili.com:80][127.0.0.1:49410] Hit User-Agent: SogouIMEMiniSetup_imepopup
[2024-06-06 15:30:46][DEBUG]: Accept 127.0.0.1:49426
[2024-06-06 15:30:46][DEBUG]: Connecting api.live.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: Connected api.live.bilibili.com:80
[2024-06-06 15:30:46][DEBUG]: [api.live.bilibili.com:80][127.0.0.1:49426] H
@SunBK201
Copy link
Owner

SunBK201 commented Jun 6, 2024

Hi @Haocen2004, 能提供下 OpenWrt 版本和 Clash 的版本吗?

@Haocen2004
Copy link
Author

主机名 | N1
-- | --
型号 | Phicomm N1 (CpuMark : 19081.693500 Scores)
架构 | ARMv8 Processor : Cortex-A53 x 4
固件版本 | OpenWrt R22.9.1
内核版本 | 5.15.67
本地时间 | 2024年06月07日 星期五 00:27:04
运行时间 | 1h 13m 9s
CPU状态 | 1512Mhz / 66.0℃
平均负载 | 78.48, 100.69, 120.58
CPU 使用率 | 92%
固件编译日期 | gd772 2022.09.16

使用 openclash v0.46.011-beta
内核版本 alpha-g5c3a9b1

btw
在查询版本号期间发现clash异常占满了cpu

@SunBK201
Copy link
Owner

SunBK201 commented Jun 6, 2024

执行命令 id -u nobody 会输出什么呢?

@Haocen2004
Copy link
Author

执行命令 id -u nobody 会输出什么呢?

65534

@SunBK201
Copy link
Owner

SunBK201 commented Jun 6, 2024

还有没有装过 ShellClash?
分别尝试执行下 id -u shellclashid -u shellcrash

@Haocen2004
Copy link
Author

Haocen2004 commented Jun 6, 2024

id -u shellcrash

没有

root@N1:~# id -u shellclash
id: unknown user shellclash
root@N1:~# id -u shellcrash
id: unknown user shellcrash

@SunBK201
Copy link
Owner

SunBK201 commented Jun 6, 2024

麻烦使用 luci 或 service 后执行 ps | grep ua3f 看看有什么输出?

@Haocen2004
Copy link
Author

Haocen2004 commented Jun 6, 2024

麻烦使用 luci 或 service 后执行 ps | grep ua3f 看看有什么输出?

使用luci启动

root@N1:~# ps | grep ua3f
12026 nobody   1198m S    /usr/bin/ua3f -b 127.0.0.1 -p 1080 -f Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 -l info
12257 root      1240 S    grep ua3f
20256 nobody   1240m S    /etc/openclash/clash -d /etc/openclash -f /etc/openclash/ua3f.yaml

@Haocen2004
Copy link
Author

emm 发现一个问题之前没注意,我从 shell 启动的 ua3f 没加 -u nobody 是可以用的
刚刚试了一下加了-u nobody 也不认了

@SunBK201
Copy link
Owner

SunBK201 commented Jun 7, 2024

从你的日志里看不出什么错误...

@Haocen2004
Copy link
Author

感觉就是单纯的 流量没有正确发给ua3f
但为什么和用户有关 用root就能收到流量 nobody就不行

@SunBK201
Copy link
Owner

SunBK201 commented Jun 7, 2024

之所以要使用 nobody 用户是因为要避免流量回环。如果你关闭了 Clash 中的接管本机流量选项的话可以使用其他用户。

@SunBK201
Copy link
Owner

SunBK201 commented Jun 8, 2024

emm 发现一个问题之前没注意,我从 shell 启动的 ua3f 没加 -u nobody 是可以用的 刚刚试了一下加了 - u nobody 也不认了

所以到底是什么状态下不能生效?

@Haocen2004
Copy link
Author

emm 发现一个问题之前没注意,我从 shell 启动的 ua3f 没加 -u nobody 是可以用的 刚刚试了一下加了 - u nobody 也不认了

所以到底是什么状态下不能生效?

就是在nobody用户组不生效 clash开启了代理本机流量

现在是跑在root用户下+关闭了代理本机流量(因为之前说遇到了高cpu占用 看日志发现是回环 加了processname的rule没用 或者说只能顶一会用)

@NuoFang6
Copy link

openclash是 Redir-Host 模式吗?fakeip模式可能导致国内网站连不上,tun模式配置错误也可能

@USS-LongIsland
Copy link

麻烦使用 luci 或 service 后执行 ps | grep ua3f 看看有什么输出?

使用luci启动

root@N1:~# ps | grep ua3f
12026 nobody   1198m S    /usr/bin/ua3f -b 127.0.0.1 -p 1080 -f Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 -l info
12257 root      1240 S    grep ua3f
20256 nobody   1240m S    /etc/openclash/clash -d /etc/openclash -f /etc/openclash/ua3f.yaml

这边也遇到了一样的问题 实测这种带空格符号之类的ua在luci界面填写时加上引号即可正常使用 单双引号都可以

@SunBK201
Copy link
Owner

SunBK201 commented Nov 9, 2024

可以试试 v0.6.0 该问题是否还存在?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants