Skip to content

xiaoeyou/uWebSockets

This branch is 893 commits ahead of, 1143 commits behind uNetworking/uWebSockets:master.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1e80fbb · Mar 2, 2018
Mar 26, 2017
Aug 13, 2017
Jun 1, 2017
Mar 2, 2018
Jan 20, 2018
Feb 27, 2017
Mar 27, 2017
Feb 22, 2018
May 6, 2016
Dec 28, 2017
Feb 22, 2018
Mar 27, 2017

Repository files navigation

µ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.

About

Tiny WebSockets

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

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