1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-28 01:32:57 +01:00

HttpServer::addrs() return all bound socket addresses

This commit is contained in:
Nikolay Kim 2017-12-26 14:45:38 -08:00
parent dd3a2aa68a
commit 9521de5746

View File

@ -189,6 +189,11 @@ impl<T, A, H, U, V> HttpServer<T, A, H, U>
self self
} }
/// Get addresses of bound sockets.
pub fn addrs(&self) -> Vec<net::SocketAddr> {
self.sockets.keys().map(|addr| addr.clone()).collect()
}
/// The socket address to bind /// The socket address to bind
/// ///
/// To mind multiple addresses this method can be call multiple times. /// To mind multiple addresses this method can be call multiple times.