Skip to content

Commit e0f6b3e

Browse files
committed
feat: sing-box Hysteria up/down 跟文档不一致, 但是懒得全转, 只处理最常见的 Mbps
1 parent 0d2920f commit e0f6b3e

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

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.19.34",
3+
"version": "2.19.35",
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/sing-box.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -567,12 +567,13 @@ const hysteriaParser = (proxy = {}) => {
567567
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
568568
// eslint-disable-next-line no-control-regex
569569
const reg = new RegExp('^[0-9]+[ \t]*[KMGT]*[Bb]ps$');
570-
if (reg.test(`${proxy.up}`)) {
570+
// sing-box 跟文档不一致, 但是懒得全转, 只处理最常见的 Mbps
571+
if (reg.test(`${proxy.up}`) && !`${proxy.up}`.endsWith('Mbps')) {
571572
parsedProxy.up = `${proxy.up}`;
572573
} else {
573574
parsedProxy.up_mbps = parseInt(`${proxy.up}`, 10);
574575
}
575-
if (reg.test(`${proxy.down}`)) {
576+
if (reg.test(`${proxy.down}`) && !`${proxy.down}`.endsWith('Mbps')) {
576577
parsedProxy.down = `${proxy.down}`;
577578
} else {
578579
parsedProxy.down_mbps = parseInt(`${proxy.down}`, 10);

0 commit comments

Comments
 (0)