NuclearC / websocket

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

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

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

License:GNU General Public License v3.0


Languages

Language:C++ 100.0%