Hproxy
http proxy base on host mapping
Install / Use
/learn @five3/HproxyREADME

说明
HProxy是一个基于HOST的HTTP代理,它与普通代理的不同之处如下:
| 对比项 | 普通代理 | HOST代理 | | --- | --- | --- | | 需要客户端支持 | 是 | 否 | | 设置方式 | 配置客户端 | 配置HOST | | 支持透明代理 | 是 | 是 | | 支持绝对路径 | 是 | 否 | | 支持非80端口 | 是 | 否 | | 实现方式 | socket | http | | URL路径支持 | 绝对路径 | 相对路径 | | 代理服务与客户端同机 | 支持 | 不支持 | | 代理配置方式 | 域名配置灵活 | host配置不灵活 |
安装
pip install git+https://github.com/five3/hproxy.git
使用
使用这个库也很简单,它只接收一个参数,用于指定插件脚本的路径,可以是绝对路径和相对路径。插件文件样例如下:
from plugins import before_proxy, after_proxy
@before_proxy
def before(context):
print(context)
@after_proxy
def after(context):
print(context)
插件脚本写完后,执行如下命令即可启动http代理服务。
hproxy -s /path/to/script.py
接着,在需要使用代理的机器上添加对应的host,假设代理服务所在ip为10.0.0.1,需要代理www.testqa.cn域名。则添加如下:
10.0.0.1 www.testqa.cn
注意:代理服务和需要使用代理的机器不能是同一个ip,否则就死循环了。
最后,通过浏览器或者程序来访问www.testqa.cn域名,则会看到插件脚本中打印的信息。
应用
- mock
- api测试
后期计划
- 协程支持
- 过滤功能
- https支持
- websocket支持
- keep-alive支持
- chunk支持
Related Skills
node-connect
352.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
