From dcf554806b700e71cb21a2361b2bc2cc88e58a0c Mon Sep 17 00:00:00 2001 From: Luk Date: Wed, 21 Jan 2026 14:12:56 +0800 Subject: [PATCH] u --- get_runmode.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/get_runmode.js b/get_runmode.js index fd2599a..ab091bd 100644 --- a/get_runmode.js +++ b/get_runmode.js @@ -1,7 +1,10 @@ // 使用Node.js实现Shell脚本逻辑:获取公网IP并检查是否以.172结尾 -const https = require('https') const { execFileSync } = require('child_process') +//https.get('https://api.ipify.org', (res) => { +// `curl -s https://ifconfig.me` returns the IP address only, but open the url in browser or https.get() returns the HTML content +// `https://api.ipify.org` returns the IP address only with curl, browser or nodejs. But it seems it doesn't work in China. + // https.get 没有同步版本,使用 child_process.execFileSync 同步获取公网 IP let ip try {