mirror of https://github.com/CrowCpp/Crow.git
Update websockets.md
This commit is contained in:
parent
3951788918
commit
849e2014dc
|
@ -1,8 +1,8 @@
|
|||
Websockets are a way of connecting a client and a server without the request response nature of HTTP.<br><br>
|
||||
Websockets are a way of connecting a client and a server without the request response nature of HTTP.<br>
|
||||
|
||||
## Routes
|
||||
To create a websocket in Crow, you need a websocket route.<br>
|
||||
A websocket route differs from a normal route quite a bit. It uses A slightly altered `CROW_WEBSOCKET_ROUTE(app, "/url")` macro, which is then followed by a series of methods (with handlers inside) for each event. These are (sorted by order of execution):
|
||||
A websocket route differs from a normal route quite a bit. It uses a slightly altered `CROW_WEBSOCKET_ROUTE(app, "/url")` macro, which is then followed by a series of methods (with handlers inside) for each event. These are (sorted by order of execution):
|
||||
|
||||
|
||||
- `#!cpp onaccept([&](const crow::request& req, void** userdata){handler code goes here})`
|
||||
|
|
Loading…
Reference in New Issue