mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 07:53:00 +01:00
HttpServer::addrs() return all bound socket addresses
This commit is contained in:
parent
dd3a2aa68a
commit
9521de5746
@ -189,6 +189,11 @@ impl<T, A, H, U, V> HttpServer<T, A, H, U>
|
||||
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
|
||||
///
|
||||
/// To mind multiple addresses this method can be call multiple times.
|
||||
|
Loading…
Reference in New Issue
Block a user