Skip to content

Commit 71f250a

Browse files
committed
feat(server): add local_addr to retrieve resolved address
1 parent 8e2f135 commit 71f250a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/server/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@ impl<L: NetworkListener> Server<L> {
204204
pub fn set_write_timeout(&mut self, dur: Option<Duration>) {
205205
self.listener.set_write_timeout(dur);
206206
}
207+
208+
/// Get the address that the server is listening on.
209+
pub fn local_addr(&mut self) -> io::Result<SocketAddr> {
210+
self.listener.local_addr()
211+
}
207212
}
208213

209214
impl Server<HttpListener> {

0 commit comments

Comments
 (0)