前言¶
DeepSeek Harness (DSH) 的核心能力依赖于插件生态。当本地网络无法直接访问 GitHub 或 api.github.com 时,开发者需要绕过网络限制。sevastopol36/dsh-plugin-ghproxy 是一个原生 Cordis 插件,它通过公共代理镜像转发请求,解决直连超时问题。该插件不依赖外部运行时库,使用 Node.js 内置模块实现。
安装¶
使用 DSH 命令行工具安装该插件:
dsh plugin --profile web add github:sevastopol36/dsh-plugin-ghproxy
安装完成后,需重启 profile(如 dsh web)以加载插件。
核心能力¶
该插件提供以下能力:
- 多镜像容错:按顺序尝试多个代理,第一个健康的胜出,失效的自动跳过。
- 健康度记忆:每个镜像的成功/失败结果缓存 5 分钟,避免反复测试不健康的镜像。
- 读取文件:支持读取 raw、blob、gist 及
api.github.com的 JSON 数据。 - 下载文件:支持下载 release 资产、仓库归档和 gist 到本地。
- 命令行加速:生成镜像 URL,供
git clone、curl或wget使用。 - 自带诊断:通过命令测试每个镜像的健康状况。
- 零运行时依赖:仅使用 Node.js 内置的
fetch、fs和stream。
使用方式¶
插件注册了以下工具:
-
读取文件
使用sevastopol36_ghproxy_fetch读取 raw / 文本 / JSON。如果文本过大或为二进制,会自动落盘。 -
下载文件
使用sevastopol36_ghproxy_download下载 raw、release 资产、archive、gist 到本地。 -
生成 URL
使用sevastopol36_ghproxy_proxy_url生成镜像 URL。 -
诊断
使用sevastopol36_ghproxy_probe实测每个镜像,并给出建议的proxyBases配置。 -
终端用法
直接使用代理 URL 进行操作:
git clone https://gh-proxy.com/https://github.com/<owner>/<repo>.git
curl -LO https://gh-proxy.com/https://github.com/<owner>/<repo>/releases/download/<tag>/<asset>
配置示例¶
插件支持通过 YAML 配置。默认配置如下:
- id: sevastopol36-ghproxy
config:
proxyBases:
- 'https://gh-proxy.com'
- 'https://sevastopol36-ghproxy.net'
- 'https://ghfast.top'
- 'https://gh.ddlc.top'
- 'https://gh.jasonzeng.dev'
downloadDir: 'downloads/github'
timeoutMs: 60000
retries: 1
retryDelayMs: 800
healthCacheMs: 300000
maxTextBytes: 262144
maxBytes: 209715200
overwrite: false
allowApi: true
注意事项¶
- 版本变更:0.1.0 版本硬编码了单一代理
https://gh.jasonzeng.dev,该服务现已失效,无法抓取任何内容。0.2.0 版本改为多镜像列表。 - 运行环境:仅支持 Node.js >= 22.19.0。
- 权限:插件以当前 DSH 进程的权限运行,请确保代理镜像不会访问敏感信息。
生态背景¶
该插件托管在社区目录,与 DeepSeek 或幻方官方无从属关系。
- 项目主页:https://github.com/sevastopol36/dsh-plugin-ghproxy
- 社区目录:https://www.skillhub.cn/plugins/sevastopol36/dsh-plugin-ghproxy