Debugging on the server

The same debugging package that is available on the client side is available on the server as well.

The debugging option can be turned on with a Node environmental variable.

Getting ready

To get started with debugging on the server side, you will need to have Node and Socket.IO installed and an existing app that uses Socket.IO. To test this out, you can easily use any of the apps we built in the previous recipes in this chapter.

How to do it…

To get server-side debugging turned on, follow these steps:

  1. To enable debugging at the time when you start your server, simply include the DEBUG environmental variable as the first argument when you start your Node server, as shown in the following code:
    DEBUG=* node server
  2. If you would like ...

Get Socket.IO Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.