Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • Thanks for the example! When I use the script I will get the following error: (node) warning: possible EventEmitter memory leak detected. 11 logging listeners added. Use emitter.setMaxListeners() to increase limit. Commented Jul 3, 2017 at 15:31
  • 1
    @user3130478 This is because a new logging event listener is added each time when there is an io connection. I've edited the code in answer and leave only one logging event listener. Please note this will make console.log(...) statement broadcast message to all client browsers. Commented Jul 3, 2017 at 23:26