/websocket

Cross-platform WebSocket implementation in C++17 on top of libuv

Primary LanguageC++GNU General Public License v3.0GPL-3.0

WebSocket

WebSocket v13 implementation in C++

Usage

#include "websocket.hpp"
...
    using namespace nc;

    loop = uv_default_loop();

    websocket::WebSocketClient ws(loop);

    ws.on_connection = [](websocket::WebSocket* ws, const websocket::HttpResponse* res) {
        ws->send<char>({16, 0, 15, 0});
        ws->send("echo hello");

        res->end();
    };

    ws.connect("ws://localhost:1501");

Dependencies