:relfileprefix: ../../
[#D2158D48C656A3B412A7F9AE17EE89DACDE3B0B0]

= Function default_port

pass:v,q[Return the default port for a known scheme]


== Synopsis

Declared in header `</boost/url/scheme.hpp#L174[boost/url/scheme.hpp,window=blank_]>`

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

== Description

pass:v,q[This function returns the default port] pass:v,q[for the known schemes. If the value does]
pass:v,q[not represent a known scheme or the scheme]
pass:v,q[does not represent a protocol, the function]
pass:v,q[returns zero.]
pass:v,q[The following ports are returned by the]
pass:v,q[function:]

* xref:boost/urls/scheme/ftp.adoc[scheme::ftp]
pass:v,q[= 21]

* xref:boost/urls/scheme/http.adoc[scheme::http,]
xref:boost/urls/scheme/ws.adoc[scheme::ws]
pass:v,q[= 80]

* xref:boost/urls/scheme/https.adoc[scheme::https,]
xref:boost/urls/scheme/wss.adoc[scheme::wss]
pass:v,q[= 443]



== Return Value

* `uint16_t` 


== Parameters

|===
| Name | Type 

| *s*
| `scheme`

|===



