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
This commit is contained in:
Chih-Hsuan Yen
2024-05-26 22:10:53 +08:00
committed by GitHub
parent d1dd8a53ca
commit 31e2a43a00
+5 -2
View File
@@ -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,
});