3

I am trying to connect to websocket using socket.io c++ library:

    sio::client h;
    h.connect("ws://echo.websocket.org");

    Again:
    h.socket()->on("connect", [&](sio::event& ev)
    {
        HIGHLIGHT("TEST");
    });

    h.socket()->on("message", [&](sio::event& ev)
    {
        HIGHLIGHT("TEST");
    });

    goto Again;

Not sure if I am doing it correctly, I just found some similar example, and tried to make basic example to work, but I am getting following error:

***2017-12-20 03:50:53] [devel] endpoint constructor
[2017-12-20 03:50:53] [devel] client constructor
[2017-12-20 03:50:53] [connect] Successful connection
[2017-12-20 03:50:53] [error] Server handshake response error: websocketpp.processor:20 (Invalid HTTP status.)
Connection failed.
Reconnect for attempt:0***

Couldn't find any solution or workaround for this, and even some working example would be great.

Jonhtra
  • 897
  • 2
  • 12
  • 18

0 Answers0