From 5f80ee78cf5ffc5d584fa6086173e9bfccb2540d Mon Sep 17 00:00:00 2001 From: MasonLiu <2857911564@qq.com> Date: Wed, 8 Jan 2025 11:32:55 +0800 Subject: [PATCH] commit dev plan --- README.md | 19 +++++++++++++++++-- checker.py | 17 +++++++++++++++++ 2 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 checker.py diff --git a/README.md b/README.md index e1a8321..1d8868d 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,17 @@ -代理池:https://uu-proxy.com/pricing -轮转代理以及存活检测功能等待后续加入 \ No newline at end of file +### 开发计划 +#### 使用代理池:https://uu-proxy.com/pricing +#### 模块分离: +- 获取模块:使用商家给出的api接口获取代理源 +- 检查模块:监测代理源中的个代理接口是否存活 +- 轮转代理模块:启动代理程序,将存活代理接口启动对应代理 +- 循环模块:定时循环以上进程 +- 配置模块:设定轮转间隔,api接口等等配置 +#### 预计使用方法: +1. 直接启用代理接口,为系统或者命令行窗口提供代理 + 参考命令行代理: + `set HTTP_PROXY=http://127.0.0.1:10809` + `set HTTPS_PROXY=http://127.0.0.1:10809` + +2. 为其他程序提供函数导入 +参考`import` +3. 转写为Go程序并打包 \ No newline at end of file diff --git a/checker.py b/checker.py new file mode 100644 index 0000000..24c682b --- /dev/null +++ b/checker.py @@ -0,0 +1,17 @@ +import requests + +proxies_list = open("proxies_list.txt", "r").read().strip().split("n") + +def get(url, proxy): + try: + # Send proxy requests to the final URL + response = requests.get(url, proxies={'http': f"http://{proxy}"}, timeout=30) + print(response.status_code, response.text) + except Exception as e: + print(e) + +def check_proxies(): + proxy = proxies_list.pop() + get("http://ident.me/", proxy) + +check_proxies() \ No newline at end of file