From 31e2a43a006891bf90b48c3c5f7bebd3a794a5a1 Mon Sep 17 00:00:00 2001 From: Chih-Hsuan Yen <1937689+yan12125@users.noreply.github.com> Date: Sun, 26 May 2024 22:10:53 +0800 Subject: [PATCH] fix(core): restore LISTEN_INADDR_ANY functionality (#15706) Somehow the functionality is lost during Hono migration [1]. Let's add it back. [1] https://github.com/DIYgod/RSSHub/commit/8e0154552ce3a5c2f9b88fa45447eb809d5ec252 --- lib/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/index.ts b/lib/index.ts index 24e7a247c..18b88329d 100644 --- a/lib/index.ts +++ b/lib/index.ts @@ -10,12 +10,15 @@ const hostIPList = getLocalhostAddress(); logger.info(`🎉 RSSHub is running on port ${port}! Cheers!`); logger.info('💖 Can you help keep this open source project alive? Please sponsor 👉 https://docs.rsshub.app/sponsor'); logger.info(`🔗 Local: 👉 http://localhost:${port}`); -for (const ip of hostIPList) { - logger.info(`🔗 Network: 👉 http://${ip}:${port}`); +if (config.listenInaddrAny) { + for (const ip of hostIPList) { + logger.info(`🔗 Network: 👉 http://${ip}:${port}`); + } } const server = serve({ fetch: app.fetch, + hostname: config.listenInaddrAny ? undefined : '127.0.0.1', port, });