added socket support to server.js