mirror of
https://github.com/certimate-go/certimate.git
synced 2026-04-25 20:55:52 +03:00
[GH-ISSUE #1021] [Feature] 支持为每个任务自定义HTTP代理 #700
Labels
No labels
announcement
backlog
bug
declined
documentation
duplicate
enhancement
good first issue
good first issue
help wanted
invalid
pull-request
question
stale
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/certimate#700
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @zuoliang0 on GitHub (Nov 3, 2025).
Original GitHub issue: https://github.com/certimate-go/certimate/issues/1021
功能描述 / Description
目前Certimate的域名监控仅能配置全局HTTP代理,但在实际应用场景下,部分域名/任务(如海外项目)需要使用代理,而另一些(如国内项目)则完全不需要代理。希望支持为每一个监控任务(或域名)单独自定义HTTP代理的配置项,实现更细粒度的代理控制。可能的方案包括:
这样可以极大提升不同网络环境下的使用灵活度与兼容性。
(如有必要,也可考虑对不同协议支持自定义,比如http/https/tls等,或提供代理配置的模版/快捷选择方式。)
请求动机 / Motivation
现在中国大陆用户、海外用户和多项目并存时场景常见。全局代理配置会导致:
支持单任务自定义代理后,可提升大规模场景下的实用性,减少代理配置冲突,让工具更好地适用于多样化实际网络需求。
其他 / Miscellaneous
1. 配置结构层面建议
配置结构设计
增加每个任务(域名监控项)的可选
proxy字段(如果为空则继承全局代理)。在全局配置中依旧保留 global proxy 字段。
2. 业务逻辑层建议
选取代理的优先级
在发起目标任务的网络请求前:
Proxy字段(task.Proxy)。3. 下游 HTTP/S 请求建议
为每个请求动态设置代理
建议将 Go 的
http.Transport.Proxy字段替换为自定义函数,支持动态按任务配置不同代理。如需 socks5,可用 golang.org/x/net/proxy:
4. 配置管理/界面建议
5. 兼容性与默认行为
参考实现(Go 代码片段)
如需支持 socks5,可以参考 golang.org/x/net/proxy。
贡献 / Contribution
@fudiwei commented on GitHub (Nov 4, 2025):
没有这样做的计划。你应该在代理层来控制流量是否要经过代理。
P.S. 请不要在 Issue 中使用 AI 生成一些看似正常实则胡说八道的内容了。