protocol::http::request::request request; protocol::http::request::parser parser(expr); if (!parser.parse(request)) ; // TODO: throw const auto &header = request.header_; if (header.connection == "Upgrade") { if (header.upgrade == "websocket") { std::cout << "Key: " << header.sec_websocket.key << std::endl; std::cout << "Version: " << header.sec_websocket.version << std::endl; std::cout << "Protocol:"; for (auto &protocol : header.sec_websocket.protocol) std::cout << " " << protocol; std::cout << std::endl; } }