我正在使用 Phonegap 开发一个应用程序,并且我正在使用带有 AutobahnJS 的 websocket 作为客户端应用程序。
远程 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 插件。
所以问题是:
有没有机会在运行 Android 4.0.4 的设备上使用 Autobahn 和 Websocket?
提前致谢!