dsh-pocket 1.12.0 → 1.12.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/tunnel.mjs +7 -1
  2. package/package.json +1 -1
package/lib/tunnel.mjs CHANGED
@@ -11,7 +11,13 @@ import { pipeline } from 'node:stream/promises';
11
11
  import { Readable } from 'node:stream';
12
12
  import { createWriteStream } from 'node:fs';
13
13
 
14
- const QUICK_TUNNEL_URL_RE = /https:\/\/[a-z0-9-]+\.trycloudflare\.com/i;
14
+ // 快速隧道 URL:https://<随机子域>.trycloudflare.com
15
+ // (?!api\.) 负向前瞻排除保留子域 api(issue #32):某些 cloudflared 版本/网络环境下
16
+ // 进程输出会先出现 https://api.trycloudflare.com(Cloudflare API 注册地址),原正则
17
+ // [a-z0-9-]+ 会把它误当隧道 URL → 设置页/二维码给出 api 地址 → 扫码打开返回
18
+ // {"code":10005,"message":"Method Not Allowed"}。api.trycloudflare.com 访问 GET 实测
19
+ // 正是该错误体,与 issue 完全一致。
20
+ export const QUICK_TUNNEL_URL_RE = /https:\/\/(?!api\.)[a-z0-9-]+\.trycloudflare\.com/i;
15
21
 
16
22
  function platformBinary() {
17
23
  const archMap = { x64: 'amd64', arm64: 'arm64' };
package/package.json CHANGED
@@ -76,5 +76,5 @@
76
76
  "access": "public",
77
77
  "registry": "https://registry.npmjs.org/"
78
78
  },
79
- "version": "1.12.0"
79
+ "version": "1.12.1"
80
80
  }