npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

dsh-net-proxy

v0.7.20

Published

DeepSeek Harness network-proxy plugin: route the agent's own network requests (web_search / web_fetch / external APIs) through a configured HTTP/HTTPS-CONNECT/SOCKS5 proxy — both the global fetch wrapper and the harness proxy layer that web_fetch actually

Downloads

514

Readme

dsh-net-proxy

awesome · DSH plugin

DeepSeek Harness 网络代理插件:让 agent 自己发起的网络请求(web_search / web_fetch / 外部 API)走你配置的 HTTP / HTTPS-CONNECT / SOCKS5 代理,配置持久化、启动即自动生效,并提供可视化设置页。

安装

dsh plugin --profile web add github:mafeis/dsh-net-proxy

安装后重启 dsh web,在 设置 → 网络代理 里启用并填写代理地址(如 127.0.0.1:7890)。

也可手动在 profile 的 cordis.patch.yml 加入:

- insert:
    - id: net-proxy
      name: 'dsh-net-proxy'

主要功能

双通道代理生效:包装 agent 进程的全局 fetch(手写 HTTP/SOCKS5 转发,零第三方依赖),同时把生效策略同步安装进 web_fetch 实际使用的 harness 代理层——两类请求全覆盖,停用/卸载完整还原。

跟随系统代理:每 3 秒读取系统代理设置,自动启停、自动跟随端口变化(v2rayN / Clash 切换无需改配置);系统关闭时自动直连;Windows ProxyOverride 绕过列表自动并入 NO_PROXY。

请求日志:经插件代理的每条请求一条记录——方法、URL、状态码、耗时、上下行流量、发送/返回内容预览;全部内存环形缓冲(最近 500 条),不落盘、不外发,占用有硬上限(< 1MB,可熔断)。

本地中继:web_fetch 流量经本地回环中继过插件之手——可观测、可统计,同时解除 harness 层的 SOCKS5 限制(socks5 配置现在全覆盖)。

流量图表:请求日志实时聚合为时间线 / 状态分布 / 耗时分布 / 通道分布 / 目标主机 TOP 10 五张自绘图表,前端纯函数聚合、零新增存储、5 秒刷新。

JSON 详情:日志点条目展开关键信息,「详情」弹窗内查看完整请求/响应内容;JSON 体自动渲染为可折叠树视图(键左对齐、缩进网格、长字符串点击展开全文),完整内容按需加载(单条 ≤256KB / 总池 ≤4MB 硬上限)。

设置页:一个一级菜单 + 页内二级标签(代理设置 / 请求日志 / 流量图表),连通性探测、地址过滤、渐进加载;配色全部走宿主主题变量,视觉与宿主一致。

最近调整

  • 总开关语义明确:「代理已启用」徽章只反映「启用代理」总开关;跟随模式下横幅格式统一「(跟随系统): 地址」(地址为真实读取的系统代理),生效与否只用红/绿横幅色表达。
  • 开关即时生效:「启用代理」「跟随系统」勾选立即应用;「保存」按钮只负责地址/端口等输入项。
  • 健壮性专项(全量代码审查,11 处):连接失败时流量日志条目收尾(防 2000 条熔断后日志永久失效);配置文件坏端口/坏协议在加载期拦截并回退默认(不再每条请求报连接错);中继背压与解压泵挂死兜底;设置页保存不再重置手改的日志配置;修复 JSON 长字符串条件 Hook 可能导致设置页白屏。
  • 修复 harness 层误杀本地中继(影响 v0.5.0–v0.7.0):「先还原再装」的中间步骤把刚启动的中继停掉,策略指向死端口——日志与自检正常但 web_fetch 全断。已修复并新增生命周期回归测试。
  • 新增中继存活看护:中继意外停止时 5 秒内自动重装策略(新端口重指),不再出现指向死端口的静默断网。
  • 日志详情弹窗:点击条目行内展开关键信息,点「详情」弹出居中详情卡片(Esc/遮罩关闭),JSON 树行式布局重做、长 URL 单行截断。
  • TOP 主机 8 → 10;配色全面回归宿主主题变量(撤销全部自定硬编码色)。

修复中继意外关闭后状态假活导致看护永不自愈的问题;跟随模式语义修正:总开关=硬闸(关=永不转发),系统代理关闭时回退手填地址而非强制直连。

  • 中继端口终身制:中继端口在插件进程内终身不变(总开关切换/策略重装不再换端口,仅卸载时关闭),保证第三方单例代理组件的地址引用永不过期。完整变更历史见 GitHub Releases。

配置字段(net-proxy.json)

| 字段 | 默认 | 含义 | |---|---|---| | enabled | false | 是否启用代理 | | followSystem | false | 跟随系统代理 | | protocol | http | http(含 CONNECT 隧道)或 socks5 | | host / port | 127.0.0.1 / 7890 | 代理地址 | | username / password | 空 | 可选认证 | | noProxy | ["127.0.0.1","localhost","::1"] | 命中则直连 | | logEnabled | true | 请求日志开关(关闭后不再记录新条目) | | logPreviewBytes | 512 | 每侧内容预览的最大字节数(0–8192,0 = 不记内容) |

技术说明

  • harness 代理层:DSH ≥ 0.1.5-rc.1 起 web_fetch 的出口不经过 globalThis.fetch,由 harness 的代理策略模块 @deepseek-ai/dsh-http-proxy 决定走向(#5)。插件定位 harness 已加载的同一模块实例(桌面端命中 app.asar 内实例,CLI 布局按 argv/bare 顺序回退)同步安装策略,停用与卸载还原到安装前状态。
  • 协议限制:harness 代理层只接受 http:// 代理 URL。协议选 socks5 时由本地中继桥接(v0.5.0 起),socks5 配置两层全覆盖;PAC 模式暂不支持自动跟随,回退手动配置并提示。
  • 隐私边界:日志与完整内容只存内存、不落盘、不外发;TLS 隧道内容加密不可见(仅记目标与字节数);二进制内容不存(只记类型与大小);清空日志即彻底消失。
  • 零运行时依赖:代理栈、中继、日志、图表全部 Node 原生模块 + 自绘实现,发布包 72.6 KB。

许可证

MIT