9using websocketpp::lib::placeholders::_1;
10using websocketpp::lib::placeholders::_2;
11using websocketpp::lib::bind;
12using websocketpp::lib::ref;
18 std::cout <<
"Cache-Control: " << con->get_request_header(
"Cache-Control") << std::endl;
20 const std::vector<std::string> & subp_requests = con->get_requested_subprotocols();
21 std::vector<std::string>::const_iterator it;
23 for (it = subp_requests.begin(); it != subp_requests.end(); ++it) {
24 std::cout <<
"Requested: " << *it << std::endl;
27 if (subp_requests.size() > 0) {
28 con->select_subprotocol(subp_requests[0]);
46 std::cout << e.
what() << std::endl;
connection_ptr get_con_from_hdl(connection_hdl hdl, lib::error_code &ec)
Retrieves a connection_ptr from a connection_hdl (exception free)
void set_validate_handler(validate_handler h)
virtual char const * what() const
Server endpoint role based on the given config.
connection_type::ptr connection_ptr
lib::weak_ptr< void > connection_hdl
A handle to uniquely identify a connection.
bool validate(server &s, connection_hdl hdl)
websocketpp::server< websocketpp::config::asio > server