diff --git a/README.md b/README.md index a885cfb..dd592e0 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@
-*µWS ("[micro](https://en.wikipedia.org/wiki/Micro-)WS") is simple and efficient[[1]](benchmarks) messaging for the modern web.* +*µWS ("[micro](https://en.wikipedia.org/wiki/Micro-)WS") is simple and efficient*[[1]](benchmarks) *messaging for the modern web.* • [Fancy pants details, user manual and FAQ](misc/READMORE.md) @@ -10,25 +10,28 @@ #### Express yourself briefly. ```c++ uWS::SSLApp({ + + /* There are tons of SSL options */ .cert_file_name = "cert.pem", .key_file_name = "key.pem" -}).onGet("/", [](auto *res, auto *req, auto *args) { + +}).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("/ws/chat", [&](auto *ws, auto *req, auto *args) { +}).onWebSocket("/ws/chat", [&](auto *ws, auto *req) { /* Subscribe to topic /chat */ - ws->subscribe("/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); + ws->publish("chat", message); } else { ws->close(); } @@ -36,7 +39,7 @@ uWS::SSLApp({ }).onClose([&](auto *ws, int code, auto message) { /* Remove websocket from this topic */ - ws->unsubscribe("/chat"); + ws->unsubscribe("chat"); }).listen("localhost", 3000, 0).run(); ```