[#boost-urls-default_port]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::default&lowbar;port
:relfileprefix: ../../
:mrdocs:

Return the default port for a known scheme

== Synopsis

Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/scheme.hpp#L174[boost&sol;url&sol;scheme&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
uint16&lowbar;t
default&lowbar;port(xref:boost/urls/scheme.adoc[scheme] s) noexcept;
----

== Description

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

The following ports are returned by the function&colon;

* `scheme&colon;&colon;ftp` &equals; 21
* `scheme&colon;&colon;http`, `scheme&colon;&colon;ws` &equals; 80
* `scheme&colon;&colon;https`, `scheme&colon;&colon;wss` &equals; 443

== Return Value

An integer with the default port number

== Parameters

[cols="1,4"]
|===
|Name|Description

| *s*
| The known scheme constant
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
