Search code examples
angularjssocket.iosails.jsionic-frameworksails.io.js

Make web socket connection between Ionic app to sails API with sails.io.js


I'm having the same issue as described here Connect from a client to a sails based server where socket continually retries to connect to sails.

I ran sails new from the command line and pulled out the latest sails.io.js file and added to my existing project I'm running sails version 0.11.0 which is a few versions ahead of the person in the question I referenced. Is there something else that could cause this?


Solution

  • Are you sure you took the correct file? The file suggested in that post will not fit to your sails app version as it will fit to 0.10.5 version only. You may take your sails.io.js file from your sails app

    mySailsApp/assets/js/dependencies/sails.io.js

    also make sure that you specify the server's url that you want to communicate with as it automaticly refers to your localhost.