diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-01-11 18:36:43 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-01-11 18:36:43 +0100 |
commit | deb28a9ce73ed7e38aaa53659027b61976fdca6b (patch) | |
tree | 7458809ca11ee8e59b32eb4aed4cd482894035dc /websocket.cpp | |
parent | 64493507905412e36848b9bd97c26f3d7a578ab5 (diff) |
Websocket for both http and https
Diffstat (limited to 'websocket.cpp')
-rw-r--r-- | websocket.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/websocket.cpp b/websocket.cpp index a4c8dfb..37d4b59 100644 --- a/websocket.cpp +++ b/websocket.cpp @@ -1,2 +1,12 @@ #include "websocket.h" + +void make_websocket_session(boost::asio::io_context& ioc, beast::tcp_stream&& stream, std::string websocket_address, request_type&& req) +{ + std::make_shared<plain_websocket_session>(ioc, std::move(stream), std::move(websocket_address))->do_accept_in(std::move(req)); +} + +void make_websocket_session(boost::asio::io_context& ioc, beast::ssl_stream<beast::tcp_stream>&& stream, std::string websocket_address, request_type&& req) +{ + std::make_shared<ssl_websocket_session>(ioc, std::move(stream), std::move(websocket_address))->do_accept_in(std::move(req)); +} |