go语言学习与应用日志

记录go语言学习与应用日志

Proxypool - WebFuzzSub

审查所有使用这个类型的站点,需要定期去维护。

安装步骤:

1.安装 go install github.com/ssrlive/proxypool@latest
2.将生成的proxypool 可执行文件,复制到整个项目的集体目录下. i.e. /Users/carlzeng/go/pkg/mod/github.com/ssrlive/proxypool@v0.7.12
3.配置文件config.yaml 和 source.yaml
4.运行 ./proxypool -c config_proxypool.yaml

以后只要搜索proxypool的source.yaml即可,拓展爬虫目标列表,
i.e. https://github.com/newcastlecy/proxypool-1/blob/master/source.yaml

1
proxypool  -c config_proxypool.json
1
2
pkill -9 proxypool
# 退出

编辑go源文件后,重新编译

1
2
3
4
5
go get
# 仅需要在git pull获取了新的依赖包以后需要运行

go build
# it will generate NEW proxypool execution file

proxypool’s banchmark url:
http://www.gstatic.com/generate_204
ttp://clients3.google.com/generate_204

错误及解决

internal/app/task.go:25:14: syntax error: unexpected :=, expected =
写在函数最上方,外层的,请使用 =


internal/app/task.go:64:19: undefined: FuzzParseProxyFromString
函数引用故障

proxypool维护

proxypool 如何直接从yaml文件中抓取地址?
    subscribe 是订阅的字符串 
        比如:https://****.com/wp-content/uploads/2023/05/20230510.txt
    webfuzz 模糊抓取是 抓取到一堆订阅字符串
        比如:https://****.gitbook.io/123/

    现在很多资源,直接给clash订阅url地址,里面包含服务器信息,我们要如何使用?
        比如:https://raw.githubusercontent.com/****/main/clash.yaml

网速低的情况,不要运行这个采集

proxypool 无法抓取当前自己本机运行的可用的节点,

重新运行“./proxypool -c config_proxypool.yaml”导致浪费了当前可用节点的尴尬局面

通过添加本机地址的方法是无效的,因为开始运行后,‘配置文件’内容马上被清空了
http://127.0.0.1:443/clash/proxies

在开始重新运行扫描/抓取时,如何才能重用当前可用的节点?
目前我无法从文件中载入
但是由于配置文件有从远端同步的github配置文件,
所以不需要这个功能了;需求优先级低,取消
转为优化:
当输出:[0008] INFO STATISTIC: WebFuzz count=0 url=https://********
是已经抓取完成了,还是正要开始抓取?
应该是抓取完成的输出,
也就是说:如果INFO信息的跳跃值很大(时间长),
说明这个抓取的站点(搭配抓取规则类型)花费太长的时间。
该网址应为:重点优化对象。

Clash load balance 方案中,服务器群,如何对新连接,会优先选择测速最快的节点?

https://github.com/Fndroid/clash_for_windows_pkg/issues/1556
https://lancellc.gitbook.io/clash/clash-config-file/proxy-groups/auto
2.自动测速的type必须是url-test,写成auto应该是错了;
本条目的名字也不该是auto,应该是url-test更恰当

修改自动生成的.yaml文件,让proxy-groups的type为url-test, 可以实现:优先选择测速最快的节点.
go build.

测试YouTube的视频,Connection Speed 3824 Kbps,自动1080P60HD,清洗流畅许多

实践测试表明,把interval设置成300,是最优解。
调整proxypool的refresh 300s, 每5分钟循环检测线路可用性

git报错处理

1
2
cmd2 := exec.Command("git", "push")
cmd2.Dir = "/Users/****/.config/clash/"

由于添加了一些git的操作,根据偶尔的网络环境又可能会报错:

1
ERROR cron.go > cmd: Exec cmd2 error: exit status 128

解决办法:

1
2
cd /Users/****/.config/clash/
git push

执行这段手动push