:relfileprefix: ../../../
[#boost-urls-url_base-remove_port]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::xref:boost/urls/url_base.adoc[pass:[url_base]]::remove_port


Remove the port


=== Synopsis

Declared in header `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/url_base.hpp#L1637[boost/url/url_base.hpp,window=blank_]>`

[source,cpp,subs="verbatim,macros,-callouts"]
----
xref:boost/urls/url_base.adoc[url_base]&
remove_port() noexcept;
----

=== Description


If a port exists, it is removed. The rest
of the authority is unchanged.
[,cpp]
----
assert( url( "http://www.example.com:80" ).remove_port().authority().buffer() == "www.example.com" );
----
[,cpp]
----
this->has_port() == false && this->port_number() == 0 && this->port() == ""
----

=== Linear in `this-&gt;size()`.

=== Throws nothing.
[,cpp]
----
authority     = [ userinfo "@" ] host [ ":" port ]

port          = *DIGIT
----

* link:https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.3[            3.2.3. Port (rfc3986)]








=== See Also


xref:boost/urls/url_base/set_port.adoc[set_port]
.



