updated socket.io implementation
dynamic io.connect based on envrionment