Getting started with Socket.io: Adding Real Time Events to your Node.js Express App
// Twilio Cloud Communications Blog
In a previous post, I explained how to monitor phone calls sent with the Twilio API in real time using call progress events. These allow you to set up a webhook url to receive a request whenever the status of your phone calls change.
The real time updates of call progress events provide us with a great opportunity to play around with websockets. In this post I am going to show you how to extend an already existing Express app to add real time communication between the client and server. We will be turning the Express server from my previous post into the backend of a dashboard for monitoring calls in real time using socket.io.
Meshblu is an open source machine-to-machine instant messaging network and API. Our API is available on HTTP REST, realtime Web Sockets via RPC (remote procedure calls), MQTT, and CoAP. We seamlessly bridge all of these protocols. For instance, an MQTT device can communicate with any CoAP or HTTP or WebSocket connected device on Meshblu.
Meshblu auto-assigns 36 character UUIDs and secret tokens to each registered device connected to the network. These device “credentials” are used to authenticate with Meshblu and maintain your device’s JSON description in the device directory.
Meshblu allows you to discover/query devices such as drones, hue light bulbs, weemos, insteons, raspberry pis, arduinos, server nodes, etc. that meet your criteria and send IM messages to 1 or all devices.
You can also subscribe to messages being sent to/from devices and their sensor activities.
Meshblu offers a Node.JS NPM module called Meshblu and a meshblu.js file for simplifying Node.JS and mobile/client-side connectivity to Meshblu.
via Netty: A Different Kind of Web(Socket) Server | Keyhole Software.
Netty is used today in all kinds of applications, all over the Internet, to handle thousands (if not millions) of chat conversations, multiplayer games including Minecraft, Twitter, and many other applications. However, it hasn’t made it very far into the mindshare of enterprise programmers developing business applications.
I believe that Netty can introduce a new wave of functionality that other solutions simply cannot match because of its fully bi-directional text and binary non-HTTP data transport, along with its support for many more concurrent clients than traditional “thread-per-socket” servers.
You may know about Netty’s prowess with WebSockets, but did you know it can function extremely well as a traditional web server? Due to its very thoughtful design, by adding appropriate handlers to its pipeline, Netty can handle virtually any traffic. It can also handle multiple types concurrently, such as WebSockets and HTTP over the same port at the same time. By combining these together, programmers are spared from dealing with nuisances such as CORS (Cross Origin Resource Sharing) that can rear their ugly head when a browser tries to make requests to servers it did not download from.
Build a polling application that updates in real-time as votes roll in. Complete instructions for creating your own polling app are in the developerWorks article, where you can run the app and get the code: