2

I am developing an cordova application for Android & iOS. In both platforms I am running the web socket servers with the help of libraries (Android, iOS) and loading my site into the cordova app with the url. In javascript am connecting to the native websocket server with ws://localhost<port>. So for working fine. But when I move my site to production server which is loaded as https. So websocket communication failed because of ws tried by giving wss but no use. :( Please help me to fix this issue.

How can I run the websocket server with wss in localhost.

Thanks.

Kushal Kumar
  • 173
  • 1
  • 14
  • 1
    You might learn something from this question: http://stackoverflow.com/questions/9745249/html5-websocket-with-ssl – online Thomas Nov 18 '15 at 12:15
  • @Thomas, Thanks for ur comment, But I know that one, So is there any way to run the websocket server with secure in iOS & Android apps. So I can connect to them with `wss://localhost` – Kushal Kumar Nov 18 '15 at 12:30
  • I don't think there is a library for mobile that has a websocket server with SSL support. But why don't you try running the server somewhere else and connect the phone(s) to it. You can send the same dat as when the phone was the server. – online Thomas Nov 18 '15 at 12:34
  • Am using this library for Android [TooTallNate](https://github.com/TooTallNate/Java-WebSocket#wss-support), they said it supports wss, there is a link in that if we need to work with android devices. And for your second question, earlier we used android device as client, For some requirement we moved to server. – Kushal Kumar Nov 18 '15 at 13:19

0 Answers0