Crow  1.0
A C++ microframework for the web
crow::WebSocketRule< App > Class Template Reference

A rule dealing with websockets. More...

#include <routing.h>

Inheritance diagram for crow::WebSocketRule< App >:

Public Member Functions

 WebSocketRule (std::string rule, App *app)
void validate () override
void handle (request &, response &res, const routing_params &) override
void handle_upgrade (const request &req, response &, SocketAdaptor &&adaptor) override
void handle_upgrade (const request &req, response &, SSLAdaptor &&adaptor) override
self_tmax_payload (uint64_t max_payload)
 Override the global payload limit for this single WebSocket rule.
template<typename Func >
self_tonopen (Func f)
template<typename Func >
self_tonmessage (Func f)
template<typename Func >
self_tonclose (Func f)
template<typename Func >
self_tonerror (Func f)
template<typename Func >
self_tonaccept (Func f)
- Public Member Functions inherited from crow::BaseRule
 BaseRule (std::string rule)
std::unique_ptr< BaseRuleupgrade ()
uint32_t get_methods ()
template<typename F >
void foreach_method (F f)
const std::string & rule ()

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 &, const std::string &)> error_handler_
std::function< bool(const crow::request &, void **)> accept_handler_
uint64_t max_payload_
bool max_payload_override_ = false
- Protected Attributes inherited from crow::BaseRule
uint32_t methods_ {1 << static_cast<int>(HTTPMethod::Get)}
std::string rule_
std::string name_
std::unique_ptr< BaseRulerule_to_upgrade_
detail::middleware_indices mw_indices_

Additional Inherited Members

- Public Attributes inherited from crow::BaseRule
std::string custom_templates_base

Detailed Description

template<typename App>
class crow::WebSocketRule< App >

A rule dealing with websockets.

Provides the interface for the user to put in the necessary handlers for a websocket to work.

The documentation for this class was generated from the following file: