- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello there,
I am having trouble connecting through websocket on a webapp. If I test my websocket connection on my desktop on chrome it works fine. When I try to test the same application, by debugging on the phone or even building the apk, it does not work. I have tried the stable and beta versions of crosswalk but it still wont work. Basically the connection cannot be established(there's no handshake) and socket.onclose gets called. I am testing on Galaxy S4 which has android 4.4.2.
I am using the crosswalk blank project as a template for my project.
This should be fairly straightforward, am I missing something ?
Is there a working example for crosswalk and websocket somewhere ?
document.addEventListener("deviceready", onDeviceReady, false); document.addEventListener("app.Ready", onAppReady, false); function onAppReady() { if (navigator.splashscreen && navigator.splashscreen.hide) { // Cordova API detected navigator.splashscreen.hide(); } if (window.intel && intel.xdk && intel.xdk.device) { // Intel XDK device API detected, but... if (intel.xdk.device.hideSplashScreen) // ...hideSplashScreen() is inside the base plugin intel.xdk.device.hideSplashScreen(); } } function onDeviceReady() { if ("WebSocket" in window) { var socket = new WebSocket('ws://myserverIP:8888'); socket.onopen = function (event) { alert("open" + event) }; socket.onmessage = function (event) { alert("message " + event); } socket.onclose = function (event) { alert("onclose " + event); } } else { alert("no websocket"); } }
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to fix the issue. The problem was with some configuration on the server instance and allowing all the connections to come through port 8888. Websocket connection is working fine on crosswalk. Thanks

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page