From 86b4573c22af46582d5018f9b86cb9f96f5f6c44 Mon Sep 17 00:00:00 2001 From: Robert Bielik Date: Sat, 28 Dec 2019 08:35:17 +0100 Subject: Add http server method for getting address --- include/nng/supplemental/http/http.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include') diff --git a/include/nng/supplemental/http/http.h b/include/nng/supplemental/http/http.h index d0854981..e0cbd501 100644 --- a/include/nng/supplemental/http/http.h +++ b/include/nng/supplemental/http/http.h @@ -437,6 +437,11 @@ NNG_DECL int nng_http_server_set_tls( NNG_DECL int nng_http_server_get_tls( nng_http_server *, struct nng_tls_config **); +// nng_http_server_get_addr obtains the address with which the server was +// initialized or returns NNG_EINVAL. Useful for instance when the port has +// been automatically assigned. +NNG_DECL int nng_http_server_get_addr(nng_http_server *, nng_sockaddr *); + // nng_http_server_set_error_page sets a custom error page (HTML) content // to be sent for the given error code. This is used when the error is // generated internally by the framework, or when the application returns -- cgit v1.2.3-70-g09d2