refine socket.io connection to server