You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/12/04 05:23:23 UTC

[GitHub] ParameshSS opened a new issue #600: Server Sent Events not working in android by using domain name URL

ParameshSS opened a new issue #600: Server Sent Events not working in android by using domain name URL
URL: https://github.com/apache/cordova-android/issues/600
 
 
   I am using this URL from Ajax “https://username:password@home.myopenhab.org/rest/events?topics=smarthome/" to get SSE(Server Sent Events) in client side application from server using Cordova.
   
       Its working fine on IOS but its not working on android
       (I am using android 7.0, latest chrome version and also enabled the webview implementation in developer options).
       for same URL if I give IP like "http://192.168.0.1/rest/events?topics=smarthome/” its working fine on both IOS and android.
   
   Note:Both URL(“https://username:password@home.myopenhab.org/rest/events?topics=smarthome/" AND "http://192.168.0.1/rest/events?topics=smarthome/”), working fine with the "cordova-crosswalk-plugin" but i dont want to use crosswalk plugin beacuse asking for download some dependency application from google play.
   
   var eventSource = new EventSource(" +“url”+ /rest/events?topics=smarthome/*");   
   
   eventSource.addEventListener(‘message’, function (eventPayload){
   
   //not entering here.
   
   }
   
   I found the solution : Reason is your URL use https
   Open “\cordova\platforms\android\CordovaLib\src\org\apache\cordova\ CordovaWebViewClient.java”. In 'onReceivedSslError' method, comment the else part and add handler.proceed() instead.
   
   But their is no file called CordovaWebViewClient.java in mentioned path. I found SystemWebViewClient.java in \cordova\platforms\android\CordovaLib\src\org\apache\cordova\engine path i have changed the handler.proceed() in else part but its not working, i am  using cordova 8.1.2.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org