dsh-rss 0.5.0 → 0.5.2
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.
- package/CHANGELOG.md +34 -0
- package/README.en.md +42 -127
- package/README.md +42 -133
- package/cordis.patch.yml +3 -1
- package/docs/CHANGELOG.en.md +27 -0
- package/docs/USAGE.en.md +104 -0
- package/docs/USAGE.md +105 -0
- package/docs/VALIDATION.md +25 -0
- package/docs/validation-2026-10-02-fakeip.md +32 -0
- package/docs/validation-language-2026-10-03.md +16 -0
- package/lib/client.js +21 -4
- package/lib/config.d.ts +4 -0
- package/lib/config.js +4 -2
- package/lib/network.js +83 -98
- package/lib/proxy-fetch.d.ts +6 -0
- package/lib/proxy-fetch.js +42 -1
- package/lib/public-dns.d.ts +3 -0
- package/lib/public-dns.js +49 -0
- package/lib/response.d.ts +2 -0
- package/lib/response.js +37 -0
- package/lib/settings.d.ts +4 -0
- package/lib/settings.js +1 -0
- package/lib/system-proxy.d.ts +7 -0
- package/lib/system-proxy.js +52 -0
- package/package.json +11 -7
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/** Read the enabled Windows manual proxy; never modify OS or VPN settings. */
|
|
2
|
+
import { execFile } from 'node:child_process';
|
|
3
|
+
export function parseWindowsProxy(output) {
|
|
4
|
+
const enabled = /^\s*ProxyEnable\s+REG_DWORD\s+(\S+)\s*$/mi.exec(output);
|
|
5
|
+
if (enabled === null || Number(enabled[1]) !== 1)
|
|
6
|
+
return undefined;
|
|
7
|
+
const server = /^\s*ProxyServer\s+REG_SZ\s+(.+)$/mi.exec(output)?.[1].trim();
|
|
8
|
+
if (!server)
|
|
9
|
+
return undefined;
|
|
10
|
+
return { server, bypass: /^\s*ProxyOverride\s+REG_SZ\s+(.+)$/mi.exec(output)?.[1].trim() ?? '' };
|
|
11
|
+
}
|
|
12
|
+
export function selectWindowsProxy(proxy, url) {
|
|
13
|
+
if (proxy === undefined)
|
|
14
|
+
return '';
|
|
15
|
+
const hostname = url.hostname.toLowerCase();
|
|
16
|
+
for (const pattern of proxy.bypass.split(';').map(value => value.trim().toLowerCase()).filter(Boolean)) {
|
|
17
|
+
if (pattern === '<local>' && !hostname.includes('.'))
|
|
18
|
+
return '';
|
|
19
|
+
const escaped = pattern.replace(/[.+?^${}()|[\]\\]/g, '\\$&').replace(/\*/g, '.*');
|
|
20
|
+
if (new RegExp('^' + escaped + '$', 'i').test(hostname))
|
|
21
|
+
return '';
|
|
22
|
+
}
|
|
23
|
+
const entries = proxy.server.split(';').map(value => value.trim()).filter(Boolean);
|
|
24
|
+
const protocol = url.protocol.slice(0, -1);
|
|
25
|
+
const selected = entries.some(value => value.includes('='))
|
|
26
|
+
? entries.find(value => value.startsWith(protocol + '='))?.slice(protocol.length + 1)
|
|
27
|
+
: entries[0];
|
|
28
|
+
if (!selected)
|
|
29
|
+
return '';
|
|
30
|
+
try {
|
|
31
|
+
const parsed = new URL(selected.includes('://') ? selected : 'http://' + selected);
|
|
32
|
+
if (parsed.protocol !== 'http:' && parsed.protocol !== 'https:')
|
|
33
|
+
return '';
|
|
34
|
+
return parsed.href;
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return '';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
export async function readWindowsProxy(signal) {
|
|
41
|
+
signal.throwIfAborted();
|
|
42
|
+
if (process.platform !== 'win32')
|
|
43
|
+
return undefined;
|
|
44
|
+
return await new Promise((resolveProxy, reject) => {
|
|
45
|
+
execFile('reg.exe', ['query', 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings'], { encoding: 'utf8', windowsHide: true, timeout: 1500, maxBuffer: 128 * 1024, signal }, (error, stdout) => {
|
|
46
|
+
if (signal.aborted)
|
|
47
|
+
reject(signal.reason);
|
|
48
|
+
else
|
|
49
|
+
resolveProxy(error === null ? parseWindowsProxy(stdout) : undefined);
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-rss",
|
|
3
|
-
"version": "0.5.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.5.2",
|
|
4
|
+
"description": "订阅和阅读 RSS / Atom,在 DSH 中查看与管理更新。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/index.d.ts",
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
"lib",
|
|
19
19
|
"cordis.patch.yml",
|
|
20
20
|
"README.md",
|
|
21
|
-
"README.en.md"
|
|
21
|
+
"README.en.md",
|
|
22
|
+
"docs",
|
|
23
|
+
"CHANGELOG.md"
|
|
22
24
|
],
|
|
23
25
|
"scripts": {
|
|
24
26
|
"build": "tsc -p tsconfig.json",
|
|
@@ -28,7 +30,9 @@
|
|
|
28
30
|
},
|
|
29
31
|
"dsh": {
|
|
30
32
|
"client": {
|
|
31
|
-
"inject": [
|
|
33
|
+
"inject": [
|
|
34
|
+
"@deepseek-ai/dsh-client-ui-settings"
|
|
35
|
+
],
|
|
32
36
|
"platform": "web"
|
|
33
37
|
},
|
|
34
38
|
"bundle": {
|
|
@@ -48,11 +52,11 @@
|
|
|
48
52
|
"node": "^22.19.0 || >=24.0.0"
|
|
49
53
|
},
|
|
50
54
|
"dependencies": {
|
|
55
|
+
"@deepseek-ai/schemastery": "^3.18.3",
|
|
51
56
|
"fast-xml-parser": "^5.0.0",
|
|
52
57
|
"schemastery": "^3.18.0",
|
|
53
|
-
"undici": "^8.
|
|
54
|
-
"yaml": "^2.9.0"
|
|
55
|
-
"@deepseek-ai/schemastery": "^3.18.3"
|
|
58
|
+
"undici": "^8.11.2",
|
|
59
|
+
"yaml": "^2.9.0"
|
|
56
60
|
},
|
|
57
61
|
"devDependencies": {
|
|
58
62
|
"@types/node": "^24.0.0",
|