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 {