Use a proxy emitter to avoid going over maxListeners.

By using a proxy emitter, the middleware will count as one listener per event that it is configured to listen to, no matter how many clients are connected. As it was before, it was easy to go over the maximum listeners for a host emitter.