Static GitHub Issues

[2180] (server) Why is 0.0.0.0 displayed as localhost?

prev: Cannot GET /
next: Project with linked nuxt can't find postcss modules

What is the reason that 0.0.0.0 is forced to be displayed as localhost on this line: https://github.com/nuxt/nuxt.js/blob/dev/lib/core/nuxt.js#L121? I used git blame but couldnt find a reason.

The thing is, 0.0.0.0 is not the same as localhost. Normally localhost runs as 127.0.0.1 so the nuxt server is only attached to the loopback interface. If you use 0.0.0.0 it means that the nuxt server will attach to all available interfaces on the server: loopback, eth0, br0, enp2s0 etc.

For me its a bit confusing as I am developing on a remote server and cant therefore use the default config localhost. But when I change it to 0.0.0.0 it still reads at localhost so sometimes when I cant reach the remote server I have to check whether my config has not been overwritten. It would be helpfull if that line could be removed so it will just read http://localhost:3000/ or http://0.0.0.0:3000

<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This feature request is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c1926">#c1926</a>)</em></sub></div>