Stiffstream / restinio

Cross-platform, efficient, customizable, and robust asynchronous HTTP(S)/WebSocket server C++ library with the right balance between performance and ease of use
Other
1.16k stars 93 forks source link

Question: How to get http_server_t<> address #215

Closed saukijan closed 7 months ago

saukijan commented 7 months ago

Hello everyone,

Is there a way to get the IP address and port of the http_server_t<> after it is constructed? I am using on_pool_runner_t<> to retain access to my http_server_t<> and allow me to start/stop the server.

eao197 commented 7 months ago

Hi!

You can try to use acceptor_post_bind_hook.

saukijan commented 7 months ago

Thank you very much @eao197 for the quick reply, that was exactly what I was looking for!