8000 GitHub - liwangGT/uWebSockets: Tiny WebSockets
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

liwangGT/uWebSockets

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

µWS ("microWS") is a WebSocket and HTTP implementation for clients and servers. Simple, efficient and lightweight.

Wiki pages & user manual

Build optimized WebSocket & HTTP servers & clients in no time.

#include <uWS/uWS.h>
using namespace uWS;

int main() {
    Hub h;
    std::string response = "Hello!";

    h.onMessage([](WebSocket<SERVER> *ws, char *message, size_t length, OpCode opCode) {
        ws->send(message, length, opCode);
    });

    h.onHttpRequest([&](HttpResponse *res, HttpRequest req, char *data, size_t length,
                        size_t remainingBytes) {
        res->end(response.data(), response.length());
    });

    if (h.listen(3000)) {
        h.run();
    }
}

Excel across the board.

Freely available.

An open source (Zlib) hobby project of mine since 2016. Sponsored by BitMEX.com since 2018.

About

Tiny WebSockets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++ 97.4%
  • Makefile 1.5%
  • Other 1.1%
0