MattSurabian/DuckHunt-JS

Change Listen IP and port

jared-bloomer opened this issue · 2 comments

I have found in webpack.config.js I can change the port the server listens on, however it always starts up with 127.0.0.1 (localhost) as the IP to listen on. Where is the setting so I change that to another IP or 0.0.0.0 for all IPs?

Hi @jared-bloomer! You're right to look in webpack.config.js! Currently I'm taking advantage of a custom port setting on line 47, this devServer object is where you could specify the host per the webpack dev server configuration: https://webpack.js.org/configuration/dev-server/ If memory serves the property can be specified there as host: '0.0.0.0' or whatever IP you desire. Then when you npm start webpack devServer should respect that setting within the devServer object just as it does for the port 👍

Also, feel free to re-open if this doesn't work for you; the version of devServer in this project is quite old and in need of an upgrade anyway.