Go to the source code of this file.
Typedefs | |
typedef websocketpp::server< websocketpp::config::asio_tls > | server |
NOTES. More... | |
typedef websocketpp::config::asio::message_type::ptr | message_ptr |
typedef websocketpp::lib::shared_ptr< websocketpp::lib::asio::ssl::context > | context_ptr |
Enumerations | |
enum | tls_mode { MOZILLA_INTERMEDIATE = 1, MOZILLA_MODERN = 2 } |
Functions | |
void | on_message (server *s, websocketpp::connection_hdl hdl, message_ptr msg) |
void | on_http (server *s, websocketpp::connection_hdl hdl) |
std::string | get_password () |
context_ptr | on_tls_init (tls_mode mode, websocketpp::connection_hdl hdl) |
int | main () |
NOTES.
This example uses a number of standard classes through the websocketpp::lib namespace. This is to allow easy switching between Boost, the C++11 STL, and the standalone Asio library. Your program need not use these namespaces if you do not need this sort of flexibility.
Definition at line 43 of file echo_server_tls.cpp.
Definition at line 50 of file echo_server_tls.cpp.
typedef websocketpp::lib::shared_ptr<websocketpp::lib::asio::ssl::context> context_ptr |
Definition at line 51 of file echo_server_tls.cpp.
enum tls_mode |
Enumerator | |
---|---|
MOZILLA_INTERMEDIATE | |
MOZILLA_MODERN |
Definition at line 79 of file echo_server_tls.cpp.
void on_message | ( | server * | s, |
websocketpp::connection_hdl | hdl, | ||
message_ptr | msg | ||
) |
Definition at line 53 of file echo_server_tls.cpp.
References websocketpp::endpoint< connection, config >::send(), and websocketpp::exception::what().
Referenced by main().
void on_http | ( | server * | s, |
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 66 of file echo_server_tls.cpp.
References websocketpp::endpoint< connection, config >::get_con_from_hdl(), and websocketpp::http::status_code::ok.
Referenced by main().
std::string get_password | ( | ) |
Definition at line 73 of file echo_server_tls.cpp.
Referenced by on_tls_init().
context_ptr on_tls_init | ( | tls_mode | mode, |
websocketpp::connection_hdl | hdl | ||
) |
Definition at line 84 of file echo_server_tls.cpp.
References get_password(), and MOZILLA_MODERN.
Referenced by main().
int main | ( | ) |
Definition at line 133 of file echo_server_tls.cpp.
References MOZILLA_INTERMEDIATE, on_http(), on_message(), on_tls_init(), websocketpp::endpoint< connection, config >::set_http_handler(), websocketpp::endpoint< connection, config >::set_message_handler(), and websocketpp::server< config >::start_accept().