9using websocketpp::lib::placeholders::_1;
10using websocketpp::lib::placeholders::_2;
11using websocketpp::lib::bind;
12using websocketpp::lib::ref;
15 std::cout <<
"Message sent to custom handler" << std::endl;
19 std::cout <<
"Message sent to default handler" << std::endl;
21 if (msg->get_payload() ==
"upgrade") {
28 std::cout <<
"Upgrading connection to custom handler" << std::endl;
void set_message_handler(message_handler h)
connection_type::message_ptr message_ptr
Server endpoint role based on the given config.
connection_type::ptr connection_ptr
void default_on_msg(server &s, connection_hdl hdl, server::message_ptr msg)
void custom_on_msg(server &s, connection_hdl hdl, server::message_ptr msg)
websocketpp::server< websocketpp::config::asio > server
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.