32 using endpoint = tcp::endpoint;
33 tcp::acceptor acceptor_;
35 acceptor_(io_context) {}
39 return acceptor_.local_endpoint().port();
41 std::string address()
const
43 return acceptor_.local_endpoint().address().to_string();
45 std::string url_display(
bool ssl_used)
const
47 auto address = acceptor_.local_endpoint().address();
48 return (ssl_used ?
"https://" :
"http://") + (address.is_v4() ? address.to_string() :
"[" + address.to_string() +
"]") +
":" + std::to_string(acceptor_.local_endpoint().port());
50 tcp::acceptor& raw_acceptor()
54 endpoint local_endpoint()
const
56 return acceptor_.local_endpoint();
58 inline static tcp::acceptor::reuse_address reuse_address_option() {
return tcp::acceptor::reuse_address(
true); }
63 using endpoint = stream_protocol::endpoint;
64 stream_protocol::acceptor acceptor_;
66 acceptor_(io_context) {}
72 std::string address()
const
74 return acceptor_.local_endpoint().path();
76 std::string url_display(
bool)
const
78 return acceptor_.local_endpoint().path();
80 stream_protocol::acceptor& raw_acceptor()
84 endpoint local_endpoint()
const
86 return acceptor_.local_endpoint();
88 inline static stream_protocol::acceptor::reuse_address reuse_address_option()
91 return stream_protocol::acceptor::reuse_address(
false);