Next.js Discord

Discord Forum

Disable dev server bind to the internet

Unanswered
Treeing Walker Coonhound posted this in #help-forum
Open in Discord
Treeing Walker CoonhoundOP
Hello, I want to disable the dev server (next dev) from being accesed from the internet, I know... I can disable the port forwading, but I don't want to do this. React support an environment variable (HOST) which can be seted to 127.0.0.1 and the dev server only be accesed via localhost. It's also possible in nextjs?

9 Replies

Dunker
no one can access your dev server
@Dunker no one can access your dev server
Treeing Walker CoonhoundOP
I have port forwarding enabled 😄
I just tested and I can access it
Dunker
i am wondering how are you accessing it tbh
basically when you deploy it, there is no localhost. while developing it, where people know it to access
If you have your network set up that external people can access your local host... You should fix that as I dont see how nextjs could...
@riský If you have your network set up that external people can access your local host... You should fix that as I dont see how nextjs could...
Treeing Walker CoonhoundOP
ok. I just curious if it s possible by nextjs because the react allowed for me to do this.
thanks 🙏
i mean you could try by using --hostname but idk if it would do your desired outcome