[Libwebsockets] Libwebsockets version upgrade breaks clients

Gregory Kip gkip at permusoft.com
Sun Jan 27 02:45:50 CET 2019


Hello,

For about six months now I have been running a series of libwebsockets clients which connect to various services. I’m not sure why but I’m built against an oddball 2.x commit: afafc13. Anyway all has been well. A setup with stands in for most of the clients is:

struct lws_client_connect_info i
bzero(&i, sizeof (struct lws_client_connect_info));
i.protocol = "wss";
i.address = “ws.myservice.com <http://ws.myservice.com/>”;
i.host = i.address;
i.port = 443;
i.path = "/";
i.ssl_connection = LCCSCF_ALLOW_SELFSIGNED;
i.protocol = protocols[0].name;
When I install the v3.1-stable branch of libwebsockets, none of my clients connect to its service, in most cases citing an HTTP "upgrade" error:

LLL_WARN: lws_client_handshake: got bad HTTP response '400'
LLL_INFO: closing connection (prot myclient) due to bail2 connection error: HS: ws upgrade response not 101
When I change the port number to 80

i.port = 80;
then some of my clients connect, apparently successfully "upgrading" an HTTP connection to WS. But others do not connect, and the connection error message is null.

In no case can I use the 3.1-stable libwebsockets build to connect to a service using my existing lws_client_connect_info setup, and in all cases does that existing setup match the various specs as specified by the respective services.

I'm not familiar with the WebSockets standard itself and so it is of course possible that I'm missing something technical. But still it seems that I should be able to connect to a service using its given configuration and any recent libwebsockets build.

What am I missing?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://libwebsockets.org/pipermail/libwebsockets/attachments/20190126/171149bd/attachment.html>


More information about the Libwebsockets mailing list