Nodejs Cordova Socketio Express Connection Error
If you are having issues connecting your iOS application to a socket.io server, check that you have the whitelisting plugin, and that you add the right endpoints to your Content-Security-Policy
meta tag on your cordova HTML index page.
In my case, I was proxying the express
server with using ngrok
, had to add the server addresses, both *http and ws:
<meta http-equiv="Content-Security-Policy" content="connect-src http://hyperlocal.ngrok.io ws://hyperlocal.ngrok.io ;default-src 'self' data: gap: https://ssl.gstatic.com 'unsafe-eval'; style-src 'self' 'unsafe-inline'; media-src *">