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, });