Git Product home page Git Product logo

uwebsockets's Introduction

Note! Unreleased development branch. Track progress & issues here. Checkout v0.14 for something stable.

µWS ("microWS") is simple and efficient[1] messaging for the modern web.

Fancy pants details, user manual and FAQ

Express yourself briefly.

uWS::SSLApp({

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

    /* Respond with the web app on default route */
    res->writeStatus("200 OK")
       ->writeHeader("Content-Type", "text/html; charset=utf-8")
       ->end(indexHtmlBuffer);
    
}).onWebSocket<UserData>("/ws/chat", [&](auto *ws, auto *req) {

    /* Subscribe to topic /chat */
    ws->subscribe("chat");
    
}).onMessage([&](auto *ws, auto message, auto opCode) {

    /* Parse incoming message according to some protocol & publish it */
    if (seemsReasonable(message)) {
        ws->publish("chat", message);
    } else {
        ws->close();
    }
    
}).onClose([&](auto *ws, int code, auto message) {

    /* Remove websocket from this topic */
    ws->unsubscribe("chat");
    
}).listen("localhost", 3000, 0).run();

Pay what you want.

A free & open source (Zlib) project since 2016. Kindly sponsored by BitMEX, Bitfinex & Coinbase in 2018.

Become a paying sponsor to unlock support, issue reporting, roadmaps and to drop suggestions.

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

uwebsockets's People

Contributors

unetworkingab avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.