69 {
72 stub_config::con_msg_manager_type::ptr msg_manager;
75 websocketpp::lib::error_code ec;
76
77 std::string handshake = "GET / HTTP/1.1\r\nHost: www.example.com\r\nConnection: upgrade\r\nUpgrade: websocket\r\nSec-WebSocket-Version: 7\r\nSec-WebSocket-Key: dGhlIHNhbXBsZSBub25jZQ==\r\n\r\n";
78
79 r.consume(handshake.c_str(),handshake.size());
80
83 ec =
p.validate_handshake(
r);
84 BOOST_CHECK(!ec);
85
87
89
90 BOOST_CHECK(u->get_valid());
91 BOOST_CHECK(!u->get_secure());
92 BOOST_CHECK_EQUAL(u->get_host(), "www.example.com");
93 BOOST_CHECK_EQUAL(u->get_resource(), "/");
94 BOOST_CHECK_EQUAL(u->get_port(), websocketpp::uri_default_port);
95
96 p.process_handshake(
r,
"",response);
97
98 BOOST_CHECK_EQUAL(response.get_header("Connection"), "upgrade");
99 BOOST_CHECK_EQUAL(response.get_header("Upgrade"), "websocket");
100 BOOST_CHECK_EQUAL(response.get_header("Sec-WebSocket-Accept"), "s3pPLMBiTxaQ9kYGzzhZRbK+xOo=");
101}
lib::shared_ptr< uri > uri_ptr
Pointer to a URI.