diff --git a/backend/package.json b/backend/package.json index 4d00074..64f8c77 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.19.60", + "version": "2.19.61", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.", "main": "src/main.js", "scripts": { @@ -27,17 +27,18 @@ "automerge": "1.0.1-preview.7", "body-parser": "^1.19.0", "buffer": "^6.0.3", - "dotenv": "^16.4.7", "connect-history-api-fallback": "^2.0.0", "cron": "^3.1.6", "dns-packet": "^5.6.1", + "dotenv": "^16.4.7", "express": "^4.17.1", - "mime-types": "^2.1.35", "http-proxy-middleware": "^3.0.3", "ip-address": "^9.0.5", "js-base64": "^3.7.2", + "json5": "^2.2.3", "jsrsasign": "^11.1.0", "lodash": "^4.17.21", + "mime-types": "^2.1.35", "ms": "^2.1.3", "nanoid": "^3.3.3", "semver": "^7.6.3", diff --git a/backend/pnpm-lock.yaml b/backend/pnpm-lock.yaml index dec8b5d..2f6590e 100644 --- a/backend/pnpm-lock.yaml +++ b/backend/pnpm-lock.yaml @@ -34,6 +34,9 @@ importers: dns-packet: specifier: ^5.6.1 version: 5.6.1 + dotenv: + specifier: ^16.4.7 + version: 16.5.0 express: specifier: ^4.17.1 version: 4.21.2 @@ -46,12 +49,18 @@ importers: js-base64: specifier: ^3.7.2 version: 3.7.7 + json5: + specifier: ^2.2.3 + version: 2.2.3 jsrsasign: specifier: ^11.1.0 version: 11.1.0 lodash: specifier: ^4.17.21 version: 4.17.21 + mime-types: + specifier: ^2.1.35 + version: 2.1.35 ms: specifier: ^2.1.3 version: 2.1.3 @@ -1655,6 +1664,10 @@ packages: resolution: {integrity: sha512-jnjyiM6eRyZl2H+W8Q/zLMA481hzi0eszAaBUzIVnmYVDBbnLxVNnfu1HgEBvCbL+71FrxMl3E6lpKH7Ge3OXA==} engines: {node: '>=0.4', npm: '>=1.2'} + dotenv@16.5.0: + resolution: {integrity: sha512-m/C+AwOAr9/W1UOIZUo232ejMNnJAJtYQjUbHoNTBNTJSvqzzDh7vnrei3o3r3m9blf6ZoDkvcw0VmozNRFJxg==} + engines: {node: '>=12'} + dunder-proto@1.0.1: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} @@ -6057,6 +6070,8 @@ snapshots: domain-browser@1.2.0: {} + dotenv@16.5.0: {} + dunder-proto@1.0.1: dependencies: call-bind-apply-helpers: 1.0.1 diff --git a/backend/src/core/proxy-utils/index.js b/backend/src/core/proxy-utils/index.js index bcd8549..0ba764c 100644 --- a/backend/src/core/proxy-utils/index.js +++ b/backend/src/core/proxy-utils/index.js @@ -25,6 +25,7 @@ import { getFlag, removeFlag, getISO, MMDB } from '@/utils/geo'; import Gist from '@/utils/gist'; import { isPresent } from './producers/utils'; import { doh } from '@/utils/dns'; +import JSON5 from 'json5'; function preprocess(raw) { for (const processor of PROXY_PREPROCESSORS) { @@ -347,6 +348,7 @@ export const ProxyUtils = { doh, Buffer, Base64, + JSON5, }; function tryParse(parser, line) { diff --git a/scripts/demo.js b/scripts/demo.js index af2423e..c056da3 100644 --- a/scripts/demo.js +++ b/scripts/demo.js @@ -133,6 +133,7 @@ function operator(proxies = [], targetPlatform, context) { // isValidUUID, // 辅助判断是否为有效的 UUID // Buffer, // https://github.com/feross/buffer // Base64, // https://github.com/dankogai/js-base64 + // JSON5, // https://github.com/json5/json5 // } // 为兼容 https://github.com/xishang0128/sparkle 的 JavaScript 覆写, 也可以直接使用 `b64d`(Base64 解码), `b64e`(Base64 编码), `Buffer`, `yaml`(简单兼容了下 `yaml.parse` 和 `yaml.stringify`)