سؤال

I am taking over an iOS application connecting to the server through a Web socket connection using the Kaazing Websocket (JMS edition) client side javascript library.

I am using Phonegap for my iOS application and be able to test it both on Chrome and the iOS simulator. About 30% of the time I get a connection error from the library testing on chrome and 70% for testing on the iOS simulator/device. I get an Exception being thrown in the minified js library which just say "ConnectionFailedException : Websocket connection failed" Seems like this is a browser specific issue but I cannot do anything further about it.

I can't directly take a look at the server located in the UK but asking them for debug logs. So I asked for the logs from server and these are the errors that I spotted out that might be the reason:

2014-03-05 08:09:23,670 [NioProcessor-15] DEBUG session.revalidate - No WebSocket authorization timeout has been configured, so no revalidate period can be inferred.
2014-03-05 08:09:23,670 [NioProcessor-15] INFO session.revalidate - WebSocket Session [176128] is not being re-validated because no timeout has been specified for the negotiated "x-kaazing-http-revalidate" extension.

Anybody have any idea about this x-kaazing-http-revalidate and if not, what is the proper way to debug these Websocket connection?

هل كانت مفيدة؟

المحلول

Full disclaimer, I work at Kaazing.

x-kaazing-http-revalidate is a Kaazing HTTP extension, negotiated while establishing WebSocket connection. This is done by setting the authorization-timeout in the gateway-config.xml file (the configuration file we ship has an example). The intention of this extension is to periodically revalidate the user's authorization, because entitlements could change over the duration of a long-running connection.

ConnectionFailedException : WebSocket connection failed can occur, if some intermediaries/proxies associated with the service providers inject an unknown or a suspicious header/s in the WebSocket connection request. If the injected header is unknown/suspicious, then Kaazing gateway will not complete the connection, to avoid intruders from eavesdropping. Using a secure TLS/SSL connection should resolve the intermediary related issues.

To debug and to setup a secure javascript client please follow instructions from the documentation. You can also use WebSocket-debug.js instead of WebSocket.js with script tags in the jms-javascript.html file for more logging. There is also a Walkthrough: Deploy a JavaScript JMS App as a Hybrid iOS App.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top