Yidien/dsh-host-router0

dsh-host-router

DSH 外挂式网络路由:按域名分流请求,支持自动嗅探访问过的域名,在设置页勾选即可热生效走本地代理。

AI 分析

核心用途是解决 DSH 访问境外 API 时的网络连接问题。适合需要精细化配置代理、避免全局代理带来延迟的用户。

包名
dsh-host-router
版本
0.1.3
最近更新
2026年8月29日

安装

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:Yidien/dsh-host-router

使用

  1. 设置页 → 「网络路由」(settings.section 独立页)。
  2. 点「扫描配置」:读 dsh 已装 provider(~/.dsh/settings.yaml 的 baseURL)+ 常见境外兜底,批量直连探测,标出"直连不通→建议代理"。
  3. 勾选要走代理的域名 → 「保存勾选」写回 ~/.dsh/host-router/config.json
  4. 「保存勾选」即即时生效(live reload,免重启;只有装/卸插件才需要重启 dsh)。
  5. 「刷新」看嗅探实时清单(dsh 用一会儿后,实际访问过的 host 带 状态/耗时/次数)。

配置

~/.dsh/host-router/config.json:

{
  "proxyHost": "127.0.0.1",
  "proxyPort": 7897,
  "proxiedHosts": ["api.openai.com", "awesome-dsh-plugin.com"],
  "sniff": true
}

proxiedHosts 命中(含子域后缀 xxx.example.com 命中 example.com)走代理;loopback 永远直连。