Skip to content

Commit

Permalink
fix: sing-box wireguard reserved
Browse files Browse the repository at this point in the history
  • Loading branch information
xream committed Feb 21, 2024
1 parent 1924e97 commit 76302f9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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.225",
"version": "2.14.226",
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
"main": "src/main.js",
"scripts": {
Expand Down
8 changes: 6 additions & 2 deletions backend/src/core/proxy-utils/producers/sing-box.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,8 +613,10 @@ const wireguardParser = (proxy = {}) => {
if (proxy['fast-open']) parsedProxy.udp_fragment = true;
if (typeof proxy.reserved === 'string') {
parsedProxy.reserved.push(proxy.reserved);
} else {
} else if (Array.isArray(proxy.reserved)) {
for (const r of proxy.reserved) parsedProxy.reserved.push(r);
} else {
delete parsedProxy.reserved;
}
if (proxy.peers && proxy.peers.length > 0) {
parsedProxy.peers = [];
Expand All @@ -628,8 +630,10 @@ const wireguardParser = (proxy = {}) => {
};
if (typeof p.reserved === 'string') {
peer.reserved.push(p.reserved);
} else {
} else if (Array.isArray(p.reserved)) {
for (const r of p.reserved) peer.reserved.push(r);
} else {
delete peer.reserved;
}
if (p['pre-shared-key']) peer.pre_shared_key = p['pre-shared-key'];
parsedProxy.peers.push(peer);
Expand Down

0 comments on commit 76302f9

Please sign in to comment.