gwelt / snake_websocket

Let multiple players battle their snakes on a web-page.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Snake multiplayer using Node.js and WebSocket

Let multiple players battle their snakes on a web-page.

curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
sudo apt-get install build-essential

Use git to clone this project

git clone https://github.com/gwelt/snake_websocket
cd snake_websocket

Install Node.js-dependencies and start the server

npm install
npm start

Connect

Open http://localhost:3000 and/or connect to your local ip on port 3000 from other devices.

Spread the snakes!

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.

About

Let multiple players battle their snakes on a web-page.


Languages

Language:JavaScript 92.8%Language:Shell 4.7%Language:HTML 2.5%