diff --git a/backend/package.json b/backend/package.json index 119cc92..6bc43a1 100644 --- a/backend/package.json +++ b/backend/package.json @@ -1,6 +1,6 @@ { "name": "sub-store", - "version": "2.14.136", + "version": "2.14.137", "description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.", "main": "src/main.js", "scripts": { diff --git a/backend/src/core/proxy-utils/parsers/index.js b/backend/src/core/proxy-utils/parsers/index.js index f8eb7c3..e08e6d4 100644 --- a/backend/src/core/proxy-utils/parsers/index.js +++ b/backend/src/core/proxy-utils/parsers/index.js @@ -742,6 +742,7 @@ function Loon_WireGuard() { let publicKey = peers.match( /(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i, )?.[2]; + // https://github.com/MetaCubeX/mihomo/blob/0404e35be8736b695eae018a08debb175c1f96e6/docs/config.yaml#L717 const proxy = { type: 'wireguard', name, @@ -768,7 +769,7 @@ function Loon_WireGuard() { ipv6, 'public-key': publicKey, 'pre-shared-key': preSharedKey, - allowed_ips: allowedIps, + 'allowed-ips': allowedIps, reserved, }, ], diff --git a/backend/src/core/proxy-utils/producers/loon.js b/backend/src/core/proxy-utils/producers/loon.js index 9eddb39..e21476b 100644 --- a/backend/src/core/proxy-utils/producers/loon.js +++ b/backend/src/core/proxy-utils/producers/loon.js @@ -285,7 +285,8 @@ function wireguard(proxy) { proxy.ipv6 = proxy.peers[0].ipv6; proxy['public-key'] = proxy.peers[0]['public-key']; proxy['preshared-key'] = proxy.peers[0]['pre-shared-key']; - proxy['allowed-ips'] = proxy.peers[0]['allowed_ips']; + // https://github.com/MetaCubeX/mihomo/blob/0404e35be8736b695eae018a08debb175c1f96e6/docs/config.yaml#L717 + proxy['allowed-ips'] = proxy.peers[0]['allowed-ips']; proxy.reserved = proxy.peers[0].reserved; } const result = new Result(proxy);