Skip to content

Commit 13a4788

Browse files
committed
feat: Egern 正式支持 VLESS REALITY(xtls-rprx-vision)
1 parent 2e12620 commit 13a4788

3 files changed

Lines changed: 46 additions & 46 deletions

File tree

backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "sub-store",
3-
"version": "2.20.32",
3+
"version": "2.20.33",
44
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and Shadowrocket.",
55
"main": "src/main.js",
66
"scripts": {

backend/src/core/proxy-utils/producers/egern.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,8 @@ export default function Egern_Producer() {
5959
!['http', 'ws', 'tcp'].includes(proxy.network) &&
6060
proxy.network) ||
6161
(proxy.type === 'vless' &&
62-
((!opts['include-unsupported-proxy'] &&
63-
(typeof proxy.flow !== 'undefined' ||
64-
proxy['reality-opts'])) ||
65-
(opts['include-unsupported-proxy'] &&
66-
typeof proxy.flow !== 'undefined' &&
67-
proxy.flow !== 'xtls-rprx-vision') ||
68-
(!['http', 'ws', 'tcp'].includes(proxy.network) &&
69-
proxy.network))) ||
62+
!['http', 'ws', 'tcp'].includes(proxy.network) &&
63+
proxy.network) ||
7064
(proxy.type === 'tuic' &&
7165
proxy.token &&
7266
proxy.token.length !== 0)
@@ -341,7 +335,13 @@ export default function Egern_Producer() {
341335
reality,
342336
},
343337
};
344-
338+
if (typeof proxy.flow !== 'undefined') {
339+
if (!['xtls-rprx-vision'].includes(proxy.flow)) {
340+
throw new Error(
341+
`VLESS flow(${proxy.flow}) is not supported`,
342+
);
343+
}
344+
}
345345
flow = proxy.flow;
346346
}
347347
proxy = {

backend/src/utils/user-agent.js

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -61,41 +61,41 @@ export function getPlatformFromHeaders(headers) {
6161
return getPlatformFromUserAgent({ ua, UA, accept });
6262
}
6363
export function shouldIncludeUnsupportedProxy(platform, ua) {
64-
try {
65-
const target = getPlatformFromUserAgent({
66-
UA: ua,
67-
ua: ua.toLowerCase(),
68-
});
69-
if (!['Egern'].includes(target)) {
70-
return false;
71-
}
72-
const coerceVersion = coerce(ua);
73-
$.log(JSON.stringify(coerceVersion, null, 2));
74-
const { version } = coerceVersion;
75-
// if (
76-
// platform === 'Stash' &&
77-
// target === 'Stash' &&
78-
// gte(version, '3.1.0')
79-
// ) {
80-
// return true;
81-
// }
82-
if (
83-
platform === 'Egern' &&
84-
target === 'Egern' &&
85-
gte(version, '2.7.0')
86-
) {
87-
return true;
88-
}
89-
// Loon 的 UA 不规范, version 取出来是 build
90-
// if (
91-
// platform === 'Loon' &&
92-
// target === 'Loon' &&
93-
// gte(version, '842.0.0')
94-
// ) {
95-
// return true;
96-
// }
97-
} catch (e) {
98-
$.error(`获取版本号失败: ${e}`);
99-
}
64+
// try {
65+
// const target = getPlatformFromUserAgent({
66+
// UA: ua,
67+
// ua: ua.toLowerCase(),
68+
// });
69+
// if (!['Egern'].includes(target)) {
70+
// return false;
71+
// }
72+
// const coerceVersion = coerce(ua);
73+
// $.log(JSON.stringify(coerceVersion, null, 2));
74+
// const { version } = coerceVersion;
75+
// // if (
76+
// // platform === 'Stash' &&
77+
// // target === 'Stash' &&
78+
// // gte(version, '3.1.0')
79+
// // ) {
80+
// // return true;
81+
// // }
82+
// if (
83+
// platform === 'Egern' &&
84+
// target === 'Egern' &&
85+
// gte(version, '2.7.0')
86+
// ) {
87+
// return true;
88+
// }
89+
// // Loon 的 UA 不规范, version 取出来是 build
90+
// // if (
91+
// // platform === 'Loon' &&
92+
// // target === 'Loon' &&
93+
// // gte(version, '842.0.0')
94+
// // ) {
95+
// // return true;
96+
// // }
97+
// } catch (e) {
98+
// $.error(`获取版本号失败: ${e}`);
99+
// }
100100
return false;
101101
}

0 commit comments

Comments
 (0)