mirror of
https://github.com/actix/actix-web.git
synced 2025-04-14 05:44:05 +00:00
HttpServer::addrs() return all bound socket addresses
This commit is contained in:
parent
dd3a2aa68a
commit
9521de5746
1 changed files with 5 additions and 0 deletions
|
@ -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 a new issue