【发布时间】:2014-05-08 01:54:23
【问题描述】:
我正在使用 Phonegap 开发一个应用程序,并且我正在将 websocket 与 AutobahnJS 一起用于客户端应用程序。
远程 websocket 服务器是使用 PHP 和 Ratchet 开发的,并通过 SSL 运行, 所以我使用 wss:// 进行连接。
应用程序在模拟器(Android 4.4.2)中运行良好,但无法使用运行 Android 4.0.4 的真实设备连接到 websocket 服务器。 onOpen 回调不会触发,只会调用 onClose。
this.conn = new ab.Session(
this.wsUri,
function() { that.onOpen() },
function() { that.onClose() },
{ // Additional parameters, we're ignoring the WAMP sub-protocol for older browsers
'skipSubprotocolCheck': true
}
);
为了使应用程序在模拟器中运行,我需要安装 websocket plugin。
所以问题是:
有没有机会在运行 Android 4.0.4 的设备上使用 Autobahn 和 Websocket?
提前致谢!
【问题讨论】:
标签: android cordova websocket autobahn