mirror of
https://github.com/sub-store-org/Sub-Store.git
synced 2025-08-10 00:52:40 +00:00
feat: Wireguard 结构跟进 Clash.Meta, allowed_ips 改为 allowed-ips
This commit is contained in:
@@ -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,
|
||||
},
|
||||
],
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user