first functional version based on SockJs