[Libwebsockets] Unable to connect to the server with Android

Andy Green andy at warmcat.com
Tue Apr 16 16:58:32 CEST 2019

On 16/04/2019 22:52, Stefano Mora wrote:
> Hello,
> I developed a ws server based on minimal sample: it is running on a Linux board.
> When I connect with browsers everything is OK.
> Now I'd like to connect with Android app and I'm using org.java-websocket:Java-WebSocket library.
> When I connect the app to the server the onOpen callback is fired with the 101 code and 'Switching Protocols' as message.
> The server does not enter in the ESTABLISHED phase and nothing else happen.

It sounds like you should watch the lws logging.

Build it with cmake -DCMAKE_BUILD_TYPE=DEBUG and enable all the log 
types (like -d 1151 or so) and take a closer look at if the logs contain 
a clue about how lws feels about the connection.


More information about the Libwebsockets mailing list