From 0a31f5d5d78dcbb8295ab8fe0d1b4fd3ef113cfe Mon Sep 17 00:00:00 2001 From: Peng-YM <1048217874pengym@gmail.com> Date: Fri, 12 Aug 2022 00:00:11 +0800 Subject: [PATCH] fix: ip-flag does not work on Loon The node parameter should not include proxy name --- scripts/ip-flag.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/scripts/ip-flag.js b/scripts/ip-flag.js index 1922159..1ae0ecf 100644 --- a/scripts/ip-flag.js +++ b/scripts/ip-flag.js @@ -117,7 +117,14 @@ async function queryIpApi(proxy) { resolve(cached); } const url = `http://ip-api.com/json`; - const node = ProxyUtils.produce([proxy], target); + let node = ProxyUtils.produce([proxy], target); + + // Loon 需要去掉节点名字 + if (isLoon) { + const s = node.indexOf("="); + node = node.substring(s + 1); + } + $.http.get({ url, headers,