:relfileprefix: ../../../ [#boost-urls-authority_view-port] == xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/authority_view.adoc[pass:[authority_view]]::port Return the port === Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- core::string_view port() const noexcept; ---- === Description If present, this function returns a string representing the port (which may be empty). Otherwise it returns an empty string. [,cpp] ---- assert( url_view( "http://localhost.com:8080" ).port() == "8080" ); ---- === Constant. === Throws nothing. [,cpp] ---- port = *DIGIT ---- * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[3.2.3. Port (rfc3986)] === See Also xref:boost/urls/authority_view/encoded_host_and_port.adoc[encoded_host_and_port] , xref:boost/urls/authority_view/has_port.adoc[has_port] , xref:boost/urls/authority_view/port_number.adoc[port_number] .