mirror of
https://git.mirrors.martin98.com/https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 15:29:17 +08:00
feat: Wireguard 结构跟进 Clash.Meta, allowed_ips
改为 allowed-ips
This commit is contained in:
parent
c0ab301160
commit
de1d40f41a
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "sub-store",
|
"name": "sub-store",
|
||||||
"version": "2.14.136",
|
"version": "2.14.137",
|
||||||
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
"description": "Advanced Subscription Manager for QX, Loon, Surge, Stash and ShadowRocket.",
|
||||||
"main": "src/main.js",
|
"main": "src/main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
@ -742,6 +742,7 @@ function Loon_WireGuard() {
|
|||||||
let publicKey = peers.match(
|
let publicKey = peers.match(
|
||||||
/(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i,
|
/(,|^)\s*?public-key\s*?=\s*?"?(.+?)"?\s*?(,|$)/i,
|
||||||
)?.[2];
|
)?.[2];
|
||||||
|
// https://github.com/MetaCubeX/mihomo/blob/0404e35be8736b695eae018a08debb175c1f96e6/docs/config.yaml#L717
|
||||||
const proxy = {
|
const proxy = {
|
||||||
type: 'wireguard',
|
type: 'wireguard',
|
||||||
name,
|
name,
|
||||||
@ -768,7 +769,7 @@ function Loon_WireGuard() {
|
|||||||
ipv6,
|
ipv6,
|
||||||
'public-key': publicKey,
|
'public-key': publicKey,
|
||||||
'pre-shared-key': preSharedKey,
|
'pre-shared-key': preSharedKey,
|
||||||
allowed_ips: allowedIps,
|
'allowed-ips': allowedIps,
|
||||||
reserved,
|
reserved,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -285,7 +285,8 @@ function wireguard(proxy) {
|
|||||||
proxy.ipv6 = proxy.peers[0].ipv6;
|
proxy.ipv6 = proxy.peers[0].ipv6;
|
||||||
proxy['public-key'] = proxy.peers[0]['public-key'];
|
proxy['public-key'] = proxy.peers[0]['public-key'];
|
||||||
proxy['preshared-key'] = proxy.peers[0]['pre-shared-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;
|
proxy.reserved = proxy.peers[0].reserved;
|
||||||
}
|
}
|
||||||
const result = new Result(proxy);
|
const result = new Result(proxy);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user