A simple web game made with Node.js
Prerequisites:
- Node.js
- npm
Install dependencies using
npm install
You can set the port numbers in config.json
Start the server using:
npm start
System (well-known) ports are port numbers in the range from 0 to 1023. You can redirect these ports to the ports your server is listening on.
To redirect ports:
sudo iptables -t nat -I PREROUTING -p tcp --dport <system port> -j REDIRECT --to-ports <server port>
To redirect ports for localhost:
sudo iptables -t nat -I OUTPUT -p tcp -o lo --dport <system port> -j REDIRECT --to-ports <server port>
To enable HTTPS, modify config.json:
"https": true,
"key": "<path to your private key>",
"cert": "<path to your certificate>"