Cleaned up some trailing spaces, made consoles more clear. Moved the client socket.on outside of the updateHistory method a problem relates to multiple event handlers being attached which causes increasingly more consoles to be reported when socket comes back. see http://stackoverflow.com/questions/17057455/socket-io-firing-multiple-events for more details