SOLVED: I solved this issue by explicitly setting the port in the url to :443 when loading the socket.io.js script. Also I downloaded the socket.io.js script and loaded it from my www/js folder instead of remotely grabbing the file.
This works great.
Now I’m ready to deploy my application and run it on heroku. So for heroku I’m doing this:
This will load the script.
My first question is: will this cause problems getting accepted in the app store as I’ve read that loading remote .js files can be problematic to being accepted in the ios app store.
My second question is the following: web sockets work locally, but not when running on heroku. On heroku I notice the following when emitting events through socket.io:
GET https://myapp.herokuapp.com:9105/socket.io/?EIO=3&transport=polling&t=1413741073385-39 net::ERR_CONNECTION_REFUSED
As you can see, the port number “9105” that I use in ionic locally is somehow being injected in the url? This is definitely wrong.
I’m using angular-socket-io as a module btw.
Any help is welcome. I’m stuck pushing this to production, so thanks for helping out!