add socket.io support for server mode