Need help with websocket connection C++
Vadvirus opened this issue · 0 comments
Vadvirus commented
Hello, how I can connect to "wss://test.deribit.com/ws/api/v2" using lws_client_connect_info and send json file. And also I cannot find which port I should be using. My code connects to binance, but not for this address. I get an error: getaddrinfo() failed.
#define DERIBIT_WS_HOST "test.deribit.com/ws/api/v2"
#define DERIBIT_WS_PORT 443
struct lws_client_connect_info ccinfo = {0};
ccinfo.context = context;
ccinfo.address = DERIBIT_WS_HOST;
//ccinfo.port = DERIBIT_WS_PORT;
ccinfo.host = lws_canonical_hostname( context );
ccinfo.path = "";
ccinfo.origin = "origin";
ccinfo.protocol = protocols[0].name;
ccinfo.ssl_connection = LCCSCF_USE_SSL | LCCSCF_ALLOW_SELFSIGNED | LCCSCF_SKIP_SERVER_CERT_HOSTNAME_CHECK;
struct lws* conn = lws_client_connect_via_info(&ccinfo);