@@ -47,14 +47,16 @@ Server::Server(const std::string& end_point,
4747 boost::asio::thread_pool& workers,
4848 std::vector<std::string> allowed_origins,
4949 std::optional<std::string> jwt_secret,
50- bool use_websocket)
50+ bool use_websocket,
51+ bool ws_compression)
5152 : rpc_api_{io_context, workers},
5253 handler_table_{api_spec},
5354 io_context_ (io_context),
5455 acceptor_{io_context},
5556 allowed_origins_{std::move (allowed_origins)},
5657 jwt_secret_ (std::move(jwt_secret)),
57- use_websocket_{use_websocket} {
58+ use_websocket_{use_websocket},
59+ ws_compression_{ws_compression} {
5860 const auto [host, port] = parse_endpoint (end_point);
5961
6062 // Open the acceptor with the option to reuse the address (i.e. SO_REUSEADDR).
@@ -79,7 +81,8 @@ Task<void> Server::run() {
7981 while (acceptor_.is_open ()) {
8082 SILK_DEBUG << " Server::run accepting using io_context " << &io_context_ << " ..." ;
8183
82- auto new_connection = std::make_shared<Connection>(io_context_, rpc_api_, handler_table_, allowed_origins_, jwt_secret_, use_websocket_);
84+ auto new_connection = std::make_shared<Connection>(io_context_, rpc_api_, handler_table_, allowed_origins_, jwt_secret_,
85+ use_websocket_, ws_compression_);
8386 co_await acceptor_.async_accept (new_connection->socket (), boost::asio::use_awaitable);
8487 if (!acceptor_.is_open ()) {
8588 SILK_TRACE << " Server::run returning..." ;
0 commit comments