SSE not working in android by using domain name

ぐ巨炮叔叔 提交于 2019-12-08 06:56:18

问题


I am using this URL from Ajax “https://username%40gmail.com:password@home.myopenhab.org/rest/events?topics=smarthome/" to get SSE in client side app using Cordova. its working fine on IOS but its not working on android. 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.

my code goes like this

var eventSource = new EventSource(" +“url”+ /rest/events?topics=smarthome/*");   


eventSource.addEventListener(‘message’, function (eventPayload)
{
//not entering here.
}

来源:https://stackoverflow.com/questions/53001770/sse-not-working-in-android-by-using-domain-name

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!