Switch branches/tags
Nothing to show
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
..
Failed to load latest commit information.
public
README.md
index.js
package.json

README.md

WebSocket Demo

A small little node project to show the power of WebSockets with socket.io.

Installation

npm install
node index # navigate to localhost:7070

Deploy

To run the node process as a daemon, I recommend using the forever npm package.

If you put nginx in front of this project (or any other project using WebSockets), make sure your virtual host is configured properly to accept the Upgrade header (you need this to "upgrade" your communication to use the WebSockets protocol). Here's a basic config example.

server {

  listen       80;
  server_name example.com;

  location / {
    proxy_pass  http://localhost:7070/;
    proxy_http_version 1.1;
    proxy_set_header Upgrade $http_upgrade;
    proxy_set_header Connection "upgrade";
    proxy_set_header Host $host;
  }
}

You would do something similar for Apache as well.