Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android library for WSS (Secure Web Socket)

Im trying to connect to WSS (client+server certificate authentication + Corporate Proxy Authentication+Self Signed Certificate Chain) from Android.

I tried Autobhan library, Koush AsyncIO, SecureWebSocket, Autobahn library with TLS support And few other.

I could not get it working.

Any suggestions on support library or least possible alterations to my server configuration to make it work (Https mandatory) ?

like image 930
Prasad.CH Avatar asked Apr 29 '14 15:04

Prasad.CH


People also ask

Which Websockets protocol to use for Android?

Always use the secure, encrypted protocol for WebSockets, wss://. ws:// refers to the unsafe WebSockets version (the http:// of WebSockets), and should be avoided for obvious reasons. Let's use Tornado as Server and nv-websocket-client as WebSocket client for Android.

Does this library support secure WebSockets?

This library supports secure and insecure WebSockets. You just need to define the scheme as wss or ws (case-sensitive) into the URI. When a Ping frame is received, automatically a Pong frame is sent with the same Application Data of the Ping frame.

Is there a jetty 9 WebSocket client for Android?

Jetty: A 2-year-ago email thread in jetty-users mailing list says "We currently have no Android compatible Jetty 9 WebSocket client. There are plans to attempt to backport the Jetty WebSocket Client from JDK 7 to JDK 5/6 for android use, but its a lower priority than finishing our implementation of JSR-356 Java WebSocket API (javax.websocket)."

Should I allow other users to establish a WebSocket connection?

If you’re using websockets for authenticated users, it is a pretty good idea to only allow authenticated users to establish a successful websocket connection. Don’t allow anyone to establish a connection and then wait for them to authenticate over the websocket itself. First of all, establishing a websocket connection is a bit expensive anyway.


3 Answers

Did you try https://github.com/TooTallNate/Java-WebSocket

I haven't used it myself, but it looks promising.

like image 86
Benito Ciaro Avatar answered Sep 18 '22 12:09

Benito Ciaro


Just recently discovered this library (nv-websocket-client). The best websocket client library for Android and Java so far. It supports WSS and RFC 7692.

like image 34
Arsenius Avatar answered Sep 19 '22 12:09

Arsenius


I am using Tyrus library. It works but only on Android 4. On Android 5 it hits a bug in Android. The bug happens only on ssl connections.

like image 44
mgiammarco Avatar answered Sep 17 '22 12:09

mgiammarco