GithubHelp home page GithubHelp logo

denizozger / node-websocket Goto Github PK

View Code? Open in Web Editor NEW
38.0 3.0 11.0 338 KB

A Node server requesting & receiving data by HTTP callls, and forwarding it to connected clients via WebSockets

JavaScript 100.00%

node-websocket's Introduction

Node.js Websocket Server

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

Running Locally

Install ZMQ first

brew install zeromq

Alternatively: http://zeromq.org/intro:get-the-software

sudo npm install
node --harmony server.js

Module versions might be old when you install this application, so especially if you get node-gyp compilation errors after installing modules, try updating module versions of related packages on package.json

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 checks if it has some-key's data on memory
  3. If some-key's data is on memory already, it serves it to connected client
  4. If some-key's data is not found, then requests it with via a socket from a specific server, ie. node-fetcher
  5. Waits to receive data for some-key, over a socket. When data is received, transmits it to clients who are connected via some-key.

Go to localhost:5000/?test1 for a demo

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

PORT=5000 node --harmony server.js

Bitdeli Badge

node-websocket's People

Contributors

bitdeli-chef avatar denizozger avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.