The introduction of HTML5 as the new standard of displaying information world web wide comes with many new possibilities.
One of the enhancements is full duplex communication between web pages and applications using a single socket, through the use of WebSockets. More information including schematic of WebSockets is available on the WebSocket.org website.
The applications of WebSockets including use in online multiplayer games such as Farmville, and real time implications such as price index. WebSockets can be used in almost any application that needs real time information and a web based interface, with the limitation being the generation of creative ways to use the technology.
Youtube video of Peter Lubbers talking about WebSockets in HTML5 event in San Francisco in 2010:
For this application, WebSocket is being considered as an option for sending a message to FrontlineSMS from a webpage and receiving a message that contains a keyword that have been defined in FrontlineSMS.
More information on WebSockets:
Websocket HTML5 tutorials
Websocket IOS tutorial
Socket IO Plugin
Websocket Chat application
PHP and Java Connection
Node Js is a platform designed for real-time data intensive applications that run across different platforms. To install Node JS, download the correct version for the operating system being used from the Node JS website. For mac and windows executable installers of the application are available, whilst a Linux install may require compiling the source files.
Once the package has been installed, Node can be accessed through the terminal by typing the command – node:
To exit the application, hit CTRL + C twice:
(^C again to quit)
To check the version of Node Js installed, enter the command:
$ node –version
Socket IO is a Node JS implementation that makes real time applications possible in any browser. The application can be installed by running the command – $ npm install socket.io – in the terminal.
After installing socket.io, you may also need to install the socket.io client, by using the command – $ npm install socket.io-client – in the terminal.
The problem that was experienced when trying to run the server.js example, by typing in the command – $node server.js was the error:
throw e; // process.nextTick error, or ‘error’ event on first tick
Error: Cannot find module ‘socket.io’
at Function._resolveFilename (module.js:332:11)
at Function._load (module.js:279:25)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at Object.<anonymous> (/Applications/MAMP/htdocs/serve.js:1:72)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
This was resolved in mac osx by copying the socket.io folder into the node_modules folder.
Web socket platform for developing real time we applications
Network application development – http://netty.io/docs/unstable/guide/html/