Re:Show HN: Piping logs, visualizing in a web app – just suf...
by ggpsv on Wednesday March 06, 2024 @11:58AM
(#39617985)
`app.listen` uses the same signature as Node's `server.listen`. You can specify the `host` [0] or else it defaults to `0.0.0.0`. This means that when you run this service, it will be accessible to anyone that can reach the server.
Typically, services allow you set the host address by configuration. This way you can set it to `127.0.0.1` so that it is only available locally.
[0]: https://nodejs.org/api/net.html#serverlistenport-host-backlo...
Re:Show HN: Piping logs, visualizing in a web app – just suf...
by gothink on Wednesday March 06, 2024 @12:10PM
(#39618140)
If you do make it configurable, it's still a good idea to make the default `127.0.0.1` for the reasons @ggpsv mentioned. Since the link automatically opens at `http://localhost:PORT` anyway, it's an easy security win.
Or I can even make a flag to configure this :thinking