The version of sails.io.js
in that repo is under active development. To safely implement socket.io
in your Sails project, you can use the sails.io.js
that is provided with new Sails projects created by the sails new
command.
That having been said, the issue here is that you need to include the dist version of the repo's sails.io.js
file, which includes the code for the socket.io
client inline. So don't include a separate copy of socket.io.js
in your project if you go that route. The new sails.io.js
has a few key benefits:
- Automatically connects to socket server
- Provides a
response
argument to request callbacks with the response status, headers, etc. - Sails will automatically detect the new version of
sails.io.js
and respond accordingly
Again, it's under development so read the doc page carefully and use at your own risk!