Skip to content

Commit

Permalink
fix: Hysteria2 输出到 Stash 时 down-speed 和 up-speed 字段截取数字部分
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Nov 20, 2023
1 parent 89e8a99 commit 6b92722
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sub-store",
"version": "2.14.93",
"version": "2.14.96",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
8 changes: 8 additions & 0 deletions backend/src/core/proxy-utils/producers/stash.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ export default function Stash_Producer() {
proxy['up-speed'] = proxy.up;
delete proxy.up;
}
if (isPresent(proxy, 'down-speed')) {
proxy['down-speed'] =
`${proxy['down-speed']}`.match(/\d+/)?.[0] || 0;
}
if (isPresent(proxy, 'up-speed')) {
proxy['up-speed'] =
`${proxy['up-speed']}`.match(/\d+/)?.[0] || 0;
}
} else if (proxy.type === 'wireguard') {
proxy.keepalive =
proxy.keepalive ?? proxy['persistent-keepalive'];
Expand Down

0 comments on commit 6b92722

Please sign in to comment.