code from http://tutorialzine.com/2014/03/nodejs-private-webchat/