Let multiple players battle their snakes on a web-page.
Install Node.js version 7.x
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install build-essential
git clone https://github.com/gwelt/snake_websocket
cd snake_websocket
npm install
npm start
Open http://localhost:3000 and/or connect to your local ip on port 3000 from other devices.
- Run ./port3000redirect.sh on your server to add redirect-rules to your IPTABLES and enable connections to http://localhost (port 80).
- If you run Apache, you can also enable these mods...
sudo a2enmod proxy proxy_wstunnel
...and then add these ProxyPass-directives to your apache.conf:
<VirtualHost *:80>
ProxyPass /socket ws://localhost:3000/
ProxyPass / http://localhost:3000/
</VirtualHost>
- Use PM2 process manager.