1

For about six months now I have been running a series of libwebsockets clients which connect to various services. All run relatively smoothly.

I've been running a libwebsockets at a git commit in the 2.x line between official releases: afafc13.

The following setup more or less matches the specs for the various services and works against my v2.x libwebsockets build:

struct lws_client_connect_info i
bzero(&i, sizeof (struct lws_client_connect_info));
i.protocol = "wss";
i.address = "ws.myservice.com
i.host = i.address;
i.port = 443;
i.path = "/";
i.ssl_connection = LCCSCF_ALLOW_SELFSIGNED;
i.protocol = protocols[0].name;

However when I build against the v3.1-stable branch of libwebsockets, none of my clients connect to its service, always 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 no error message is given.

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 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?

QED
  • 9,803
  • 7
  • 50
  • 87

0 Answers0