diff --git a/src/server.rs b/src/server.rs index e5ee5c50e..ab024c8c1 100644 --- a/src/server.rs +++ b/src/server.rs @@ -189,6 +189,11 @@ impl HttpServer self } + /// Get addresses of bound sockets. + pub fn addrs(&self) -> Vec { + self.sockets.keys().map(|addr| addr.clone()).collect() + } + /// The socket address to bind /// /// To mind multiple addresses this method can be call multiple times.