A rule dealing with websockets. More...
Public Member Functions | |
WebSocketRule (std::string rule) | |
void | validate () override |
void | handle (request &, response &res, const routing_params &) override |
void | handle_upgrade (const request &req, response &, SocketAdaptor &&adaptor) override |
template<typename Func > | |
self_t & | onopen (Func f) |
template<typename Func > | |
self_t & | onmessage (Func f) |
template<typename Func > | |
self_t & | onclose (Func f) |
template<typename Func > | |
self_t & | onerror (Func f) |
template<typename Func > | |
self_t & | onaccept (Func f) |
std::unique_ptr< BaseRule > | upgrade () |
uint32_t | get_methods () |
template<typename F > | |
void | foreach_method (F f) |
const std::string & | rule () |
Public Attributes | |
std::string | custom_templates_base |
Protected Attributes | |
std::function< void(crow::websocket::connection &)> | open_handler_ |
std::function< void(crow::websocket::connection &, const std::string &, bool)> | message_handler_ |
std::function< void(crow::websocket::connection &, const std::string &)> | close_handler_ |
std::function< void(crow::websocket::connection &)> | error_handler_ |
std::function< bool(const crow::request &)> | accept_handler_ |
uint32_t | methods_ {1 << static_cast<int>(HTTPMethod::Get)} |
std::string | rule_ |
std::string | name_ |
std::unique_ptr< BaseRule > | rule_to_upgrade_ |
Private Types | |
using | self_t = WebSocketRule |
A rule dealing with websockets.
Provides the interface for the user to put in the necessary handlers for a websocket to work.
|
private |
|
inline |
|
inlineoverridevirtual |
Implements crow::BaseRule.
|
inlineoverridevirtual |
Reimplemented from crow::BaseRule.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
inherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |