mardi 28 septembre 2021

easywsclient websocket connection issues

I am using https://github.com/dhbaird/easywsclient

The following code wont connect properly, ws comes back as a NULL always and the connection "stucks".

using easywsclient::WebSocket;
ws = WebSocket::from_url("ws://mysite.net:80/app/");

assert(ws);

I tried debuggin it and at easywsclient.cpp (github link above) line 514 (code below) gives really weird values for "status" and this is where it fails it seems. I can't figure out why this is happening, the webapp works fine in my browser

if (sscanf(line, "HTTP/1.1 %d", &status) != 1 || status != 101) { fprintf(stderr, "ERROR: Got bad status connecting to %s: %s and status is %d", url.c_str(), line, status); return NULL; }

This is somewhat new terrority to me so I clearly am not understanding something. Any help is appreciated, thanks!




Aucun commentaire:

Enregistrer un commentaire