:relfileprefix: ../../
[#boost-urls-default_port]

== xref:boost.adoc[pass:[boost]]::xref:boost/urls.adoc[pass:[urls]]::default_port


Return the default port for a known scheme


=== Synopsis

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

[source,cpp,subs="verbatim,macros,-callouts"]
----
std::uint16_t
default_port(xref:boost/urls/scheme.adoc[scheme] s) noexcept;
----

=== Description


This function returns the default port
for the known schemes. If the value does
not represent a known scheme or the scheme
does not represent a protocol, the function
returns zero.

The following ports are returned by the
function:

* xref:boost/urls/scheme/ftp.adoc[scheme::ftp]
&equals; 21

* xref:boost/urls/scheme/http.adoc[scheme::http]
,
xref:boost/urls/scheme/ws.adoc[scheme::ws]
&equals; 80

* xref:boost/urls/scheme/https.adoc[scheme::https]
,
xref:boost/urls/scheme/wss.adoc[scheme::wss]
&equals; 443




=== Return Value


An integer with the default port number



=== Parameters

|===
| Name | Description 

| *s*
| 
The known scheme constant

|===




