The Wayback Machine - https://web.archive.org/web/20190322174604/https://github.com/uNetworking/uWebSockets
Skip to content
Please note that GitHub no longer supports Internet Explorer.

We recommend upgrading to the latest Microsoft Edge, Google Chrome, or Firefox.

Learn more
Branch: master
Clone or download
Latest commit af9513e Mar 14, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
benchmarks Update README.md Mar 13, 2019
examples
fuzzing Update README.md Mar 13, 2019
misc Add gobwas/ws to benchmark results Feb 13, 2019
src Also fuzz the extensions negotiator Mar 13, 2019
uSockets @ 7574cd2 Update uS Mar 10, 2019
.gitmodules Set up projects May 6, 2018
LICENSE Apache License 2.0 Oct 28, 2018
Makefile Add threaded websocket server, skip broken examples Mar 1, 2019
README.md

README.md

µWebSockets™ (it's "micro") is simple, secure[1] & standards compliant web I/O for the most demanding[2] of applications.

Read moreSee uWebSockets.js

Express yourself briefly.

uWS::SSLApp({

    /* There are tons of SSL options */
    .cert_file_name = "cert.pem",
    .key_file_name = "key.pem"
    
}).get("/hello", [](auto *res, auto *req) {

    /* You can efficiently stream huge files too */
    res->writeHeader("Content-Type", "text/html; charset=utf-8")->end("Hello HTTP!");
    
}).ws<UserData>("/*", {

    /* Just a few of the available handlers */
    .open = [](auto *ws, auto *req) {
        ws->subscribe("buzzword weekly");
    },
    .message = [](auto *ws, std::string_view message, uWS::OpCode opCode) {
        ws->send(message, opCode);
    }
    
}).listen(9001, [](auto *token) {

    if (token) {
        std::cout << "Listening on port " << 9001 << std::endl;
    }
    
}).run();

Don't miss the user manual, the C++ examples or the JavaScript examples. JavaScript examples are very applicable to C++ developers, so go through them as well.

Pay what you want.

A free & open source (permissive) project since 2016. Kindly sponsored by BitMEX, Bitfinex & Coinbase in 2018 and/or 2019. Individual donations are always accepted via PayPal.

Code is provided as-is, do not expect or demand free consulting services, personal tutoring, advice or debugging.

Deploy like a boss.

Commercial support is available via a per-hourly consulting plan or as otherwise negotiated. If you're stuck, worried about design or just in need of help don't hesitate throwing me, the author a mail and we'll figure out what's best for both parties. I want your business to have a proper understanding of the problem before rushing in to one of the many pitfalls.

Excel across the board.

All that glitters is not gold. Especially so in a market driven by flashy logos, hype and pointless badges.

Http WebSockets

Keep it legal.

Intellectual property, all rights reserved.

You are forbidden to use logos, product names, texts, names or otherwise perceived brand identity, of copyright holder, in any way that might state or imply that the copyright holder endorses your distribution or in any way that might state or imply that you created the original software. Modified distributions must carry, from the original distribution, significantly different names and must not be confused with the original distribution.

You can’t perform that action at this time.