Added an emit function as a proxy for the socket.