Available APIs

Client IP

Simple REST resource that returns the Client IP as seen by the server.

Random Number

Resource that generates a random number between 0 and 65535. The service deliberately takes a few seconds to return.

WebSocket Clock

Subscribe to the "timeserver" events on the WebSocket, and update the clock div in the upper right corner when events are received.


This is just a showcase web application. Used for testing ideas for client/server interaction.

The client is HTML5 and Javascript augmented by jQuery, Bootstrap, WebSockets and some pink fairy dust. On the server side, CodeIgniter (PHP) with the REST_Controller extension provides the REST resources. The REST_Controller has been slightly extended to provide a convenient means for publishing info and request progress information for REST resources that take time to return.

To provide support for asynchronous communication, node.js serves a WebSocket server, and two ZeroMQ (0MQ) queues. The first queue is a push-pull queue that lets anything on the server push events to the hub. The hub then publishes the events to the second, pub-sub queue. This queue lets any thread subscribe to any event type/topic.

Each WebSocket client can send in "subscribe" messages, which makes the client's server thread subscribe to the corresponding event type in the pub-sub queue. Each subscribed message from the queue is then immediately sent to the client over the WebSocket, where the client code runs a handler function for that message type.


If you're worthy, you can look up the Tech-c Handle on my domain name. May the force be with you ;-)