Many outdated tutorials will tell you that you need to add the below code to your server in order for socket.io code to work.
1 2 3 4 |
|
However, in newer versions of socket.io (v1.x.x), the set() and configure() methods are deprecated, as outlined here, and they result in the error “io.configure is not a function”. Instead, you should pass in the settings when you initialize the instance, like this:
1 2 3 4 |
|
Also, in your client code you should use the “ws” protocol instead of “http” when trying to connect.
That should be all you need to get your app running!