xiaoeyou/uWebSockets

Forked from uNetworking/uWebSockets

Tiny WebSockets

License: Zlib

Language: C++


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

Read more

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.

Non-profit open source (Zlib) since 2016.

Project Statistics

Sourcerank 3
Repository Size 2.35 MB
Stars 1
Forks 0
Watchers 1
Open issues disabled
Dependencies 0
Tags 19
Created
Last updated
Last pushed

Recent Tags See all

v0.14.5 December 28, 2017
v0.14.4 August 10, 2017
v0.14.3 June 01, 2017
v0.14.2 April 02, 2017
v0.14.1 March 28, 2017
v0.14.0 March 28, 2017
v0.13.0 February 20, 2017
v0.12.0 December 03, 2016
v0.11.0 October 25, 2016
v0.10.0 October 05, 2016
v0.9.0 September 11, 2016
v0.8.0 August 22, 2016
v0.7.0 June 29, 2016
v0.6.0 June 26, 2016
v0.5.0 June 16, 2016

Something wrong with this page? Make a suggestion

Last synced: 2018-03-06 05:36:38 UTC

Login to resync this repository