[Libwebsockets] stuck on url

Andy Green andy at warmcat.com
Tue May 18 06:16:43 CEST 2021



On 5/17/21 9:22 PM, Trey Weaver wrote:
> I am trying to get our system to connect to a wss server called:  
> wss://xxx.io/ws/jpsdemo <http://zellowork.io/ws/jpsdemo>
> 
> I know that I can not do a dns lookup on the whole thing.  So I tried 
> the following:

https://libwebsockets.org/git/libwebsockets/tree/include/libwebsockets/lws-misc.h#n418-441

https://libwebsockets.org/git/libwebsockets/tree/test-apps/test-client.c#n698

> *lws_client_connect_info.address = xxx.io**
> *
> *lws_client_connect_info.host = wss://**xxx.io/ws/jpsdemo* 
> <http://xxx.io/ws/jpsdemo>
> 
> And it looks like it does the dns correctly (which is 3 ip addresses), 
> but it looks like it never goes to the full URI.   And does not connect.
> 
> Below is the debug.  I am using wolfssl if that makes any difference.

> [2021/05/17 19:34:25:3961] U: test not zero 0x69.
> [2021/05/17 19:34:25:3967] D: lws_client_connect_3_connect: connect: 
> errno: 115

errno 115 is EINPROGRESS, which is normal.

If it just ends there, it looks like you are not going around the event 
loop.  Reference the examples and what they are doing after creating the 
context.

The examples are CC0 so you can literally cut and paste them and start 
modifying them, it saves me time compared to this no-win game of "guess 
what I did wrong without seeing the code", and it saves you time since 
by having it work from the start, if you break it, you just have to back 
out your last change to know what you did wrong.

-Andy


More information about the Libwebsockets mailing list