dynamically adapt socket.io uri to which client connects