The configuration options and well thought out methods of
socket.io make for a highly versatile library. Let's explore the dexterity of
socket.io by creating a real-time widget that can be placed on any website and instantly interfacing it with a remote Socket.IO server. We're doing this to begin providing a constantly updated total of all users currently on the site. We'll name it the live online counter (
loc for short).
Our widget is for public consumption and should require only basic knowledge, so we want a very simple interface. Loading our widget through a
script tag and then initializing the widget with a prefabricated
init method would be ideal (this allows us to predefine properties before initialization if ...