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-mobile-gateway

v0.2.1

Published

手机访问网关:局域网扫码 + 公网隧道,把电脑上的 DSH 实时同步到手机(含设置页)。

Readme

dsh-mobile-gateway

手机访问网关:一个包、一个设置页,手机扫码即同步访问电脑上的 DSH(局域网 + 公网,实时同屏)。

参考 dsh-pocket 精简而来,只保留手机网关功能和设置页面:反向代理 + cloudflared 公网隧道 + 扫码设置页。去掉了 CLI、自动更新/重启、桌面端特判等外围功能。

安装

前提:电脑上已装好 DeepSeek Harness(dsh 命令可用)。

# 1. 装插件(网关 + 移动端窄屏适配,两个都要装)
dsh plugin --profile web add dsh-mobile-gateway -w
dsh plugin --profile web add dsh-web-mobile -w

# 2. 重启 dsh web
npx @deepseek-ai/dsh web

重启后打开 设置,左侧边栏有 「手机访问」 入口。

本插件是纯网关(反向代理 + 隧道 + 扫码),不管手机窄屏布局;请搭配 dsh-web-mobile 使用,经本网关访问会自动带上它的移动端样式,无需额外配置。

使用

局域网(同一 WiFi)

设置 → 手机访问 → 手机扫「局域网」二维码 → 输入局域网密码(显示在设置页,可刷新/自定义)→ 打开的就是电脑上的 DSH,实时同步。

  • 「局域网访问」开关默认开:关闭后局域网二维码/链接立即失效(公网不受影响)。
  • 局域网密码默认开启;嫌麻烦可在设置页关掉(局域网扫码直连;公网始终要密码)。
  • 手机登录一次后长期免输(绑定电脑上的 dsh web 进程;dsh web 重启后需重新输入一次)。
  • 高级选项:「局域网地址」下拉框可手动选择已检测到的 IP(Tailscale/VPN 等场景)。
  • 高级选项:「受信任的局域网域名」可填写自定义域名(如反代用的 ai.lan),命中这些域名的访问按局域网处理——跳过公网保护,局域网密码关闭时即免密;支持多个(逗号分隔)和 *.example.com 通配。用于解决自定义局域网域名被误判成公网、强行索要公网密码的问题。

公网(人在外面)

设置页「公网访问」里先选公网通道(切换前需先关闭公网):

  • Cloudflare(默认):点「开启公网访问」→ 勾选安全免责声明 → 等隧道建立(首次会下载 cloudflared)→ 手机扫「公网」二维码 → 输入访问密码。
    • 公网密码默认每次开启换新(旧链接作废);可自定义固定密码(8–64 位字母/数字),自定义后不再换新。
    • 想要固定公网地址:用「固定域名」模式(Cloudflare 命名隧道:填 Tunnel Token + 自己的域名,Service 指向本机代理端口)。
  • Tailscale(Funnel):设置页切到 Tailscale 通道再开启 → 公网地址是稳定的 https://<本机>.<tailnet>.ts.net,手机扫码输入访问密码即可。
    • 组件按需安装(和 cloudflared 一样,选中开启后才下载,不预装):Linux 自动下载官方静态包(约 30MB,固定版本 + sha256 校验,仅存插件私有目录,并起插件自己的 userspace 守护进程,不写系统服务);macOS/Windows 没有可私有化的官方包,请先装官方客户端并登录一次,再回来开启。
    • 首次需要去 Tailscale 官方页面完成一次浏览器登录:开启失败时设置页会出现「去登录 Tailscale」按钮,登完重新点开启即可(登录态持久化,之后不再打扰;插件不碰你的账号密码)。
    • 地址长期固定,公网密码默认不轮换(建议设自定义强密码)。
    • 需要 tailnet 管理员批准 Funnel(https://tailscale.com/s/no-funnel);国内网络下通常比 Cloudflare 稳。
    • 同样强制访问密码:*.ts.net 按公网判定,免密进不来。

安全(必读)

  • DSH 能执行你电脑上的代码。局域网二维码/URL + 独立 8 位密码才是钥匙,请勿发给别人。
  • 开启公网前必须阅读并勾选免责声明:公网 = 把能执行代码的 DSH 暴露到互联网,请用强密码、用完即关、涉密网络勿用。
  • 登录限速:同一 IP 连续输错 5 次锁定 60 秒;全局失败超阈值短暂全锁。
  • 公网密码存本机 $DSH_HOME/dsh-mobile-gateway/token,局域网密码存 token-lan,开关存 settings.json。

架构

| 文件 | 说明 | | ------------------ | ----------------------------------------------------------- | | lib/index.js | 插件入口:自动起代理 + 注册 RPC + 访问密码管理 + 隧道模式 | | lib/settings.mjs | 设置持久化:$DSH_HOME/dsh-mobile-gateway/settings.json | | lib/service.mjs | 服务:代理生命周期、公网隧道(自动恢复)、状态快照(含二维码)| | lib/proxy.mjs | 改头反向代理:Host/Origin → loopback,HTTP + WebSocket 透传 + 压缩 + 访问令牌认证 | | lib/tunnel.mjs | cloudflared:多镜像源下载 / 启动 / 解析公网 URL | | lib/tailscale.mjs | Tailscale Funnel:本机预检(登录态/DNSName)/ 开启 / 解析公网 URL / 关闭 | | lib/web-rpc.js | loopback RPC:status / tunnel.start / tunnel.stop / 开关与密码管理 | | client/ | 设置页「手机访问」(纯网关) |

开发

npm install
node client/build.mjs   # 改 client/ 后重新打包

🤝 致谢

  • 本插件的网关核心(反向代理、隧道、扫码设置页)基于 dsh-pocket 精简而来,感谢原作者的开源工作。
  • 公网隧道基于 cloudflared;Tailscale 通道基于 Tailscale(Funnel)。

License

GPL-2.0