Skip to content

A Node server requesting & receiving data by ZMQ messages and forwarding it to connected clients via web sockets (Engine.io)

Notifications You must be signed in to change notification settings

denizozger/node-engine.io-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Node.js Engine.io Server

This Node application perioducally receives JSON data from another web application, and serves it to clients connected to it.

Installation

brew install redis
redis-server
npm install

Running Locally

node --harmony server.js

How it works

Please see node-fetcher and node-dataprovider implementations too, all three applications work together - although not necessarily.

  1. A client connects to the application. ie. ws://node-websocket/some-key
  2. App subscribes this client to some-key channel in Redis
  3. App checks if there's data for some-key in Redis.
  4. If some-key's data is in Redis already, it serves it to connected client
  5. If some-key's data is not found, then requests it with via a socket from a specific server, ie. node-fetcher
  6. Waits to receive data for some-key, over a ZMQ socket. When data is received, saves it to Redis (triggering subscribers to receive the message).

Go to localhost:5000/?matchesfeed/8/matchcentre for a demo

When you have all three applications, you should start node-socketio as:

PORT=5000 FETCHER_ADDRESS='http://localhost:4000/fetchlist/new/' REDIS_DEBUG=true node --harmony server.js

Bitdeli Badge

About

A Node server requesting & receiving data by ZMQ messages and forwarding it to connected clients via web sockets (Engine.io)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published