From 849fab7227a2fd1ff5fa4d603ba89037e1c462b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Tue, 26 May 2020 09:54:54 +0200 Subject: Cowboy 2.8.0 --- .../cowboy/2.2/manual/cowboy.start_tls/index.html | 234 --------------------- 1 file changed, 234 deletions(-) delete mode 100644 docs/en/cowboy/2.2/manual/cowboy.start_tls/index.html (limited to 'docs/en/cowboy/2.2/manual/cowboy.start_tls/index.html') diff --git a/docs/en/cowboy/2.2/manual/cowboy.start_tls/index.html b/docs/en/cowboy/2.2/manual/cowboy.start_tls/index.html deleted file mode 100644 index 33b119de..00000000 --- a/docs/en/cowboy/2.2/manual/cowboy.start_tls/index.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - - - Nine Nines: cowboy:start_tls(3) - - - - - - - - - - - - - - - - -
-
-
-
- -

cowboy:start_tls(3)

- -

Name

-

cowboy:start_tls - Listen for connections using TLS

-

Description

-
-
start_tls(Name          :: ranch:ref(),
-          TransportOpts :: ranch_ssl:opts(),
-          ProtocolOpts  :: opts())
-    -> {ok, ListenerPid :: pid()}
-     | {error, any()}
-
-

Start listening for connections over a secure TLS channel.

-

Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection.

-

Arguments

-
Name
-

The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined.

-

It can be any Erlang term. An atom is generally good enough, for example api, my_app_clear or my_app_tls.

-
-
TransportOpts
-

The transport options are where the TCP options, including the listener's port number, are defined. They also contain the TLS options, like the server's certificate. Transport options are provided as a list of keys and values, for example [{port, 8443}, {certfile, "path/to/cert.pem"}].

-

The available options are documented in the ranch_ssl(3) manual.

-
-
ProtocolOpts
-

The protocol options are in a map containing all the options for the different protocols that may be involved when connecting to the listener, including HTTP/1.1 and HTTP/2.

-

The HTTP/1.1 options are documented in the cowboy_http(3) manual; and the HTTP/2 options in cowboy_http2(3).

-
-
-

Return value

-

An ok tuple is returned on success. It contains the pid of the top-level supervisor for the listener.

-

An error tuple is returned on error. The error reason may be any Erlang term.

-

A common error is eaddrinuse. It indicates that the port configured for Cowboy is already in use.

-

Changelog

-
  • 2.0: HTTP/2 support added. -
  • -
  • 2.0: Function introduced. Replaces cowboy:start_https/4. -
  • -
-

Examples

-
Start a listener
-
-
Dispatch = cowboy_router:compile([
-    {'_', [
-        {"/", toppage_h, []}
-    ]}
-]),
-
-{ok, _} = cowboy:start_tls(example, [
-    {port, 8443},
-    {cert, "path/to/cert.pem"}
-], #{
-    env => #{dispatch => Dispatch}
-}).
-
-
Start a listener on a random port
-
-
Name = example,
-
-{ok, _} = cowboy:start_tls(Name, [
-    {cert, "path/to/cert.pem"}
-], #{
-    env => #{dispatch => Dispatch}
-}),
-
-Port = ranch:get_port(Name).
-
-

See also

-

cowboy(3), cowboy:start_clear(3), cowboy:stop_listener(3), ranch(3)

- - - - - - -
- -
- - -

- Cowboy - 2.2 - Function Reference - -

- - - -

Navigation

- -

Version select

- - -

Like my work? Donate!

-

Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic:

-
- - - - - - - - - -

Recurring payment options are also available via GitHub Sponsors. These funds are used to cover the recurring expenses like food, dedicated servers or domain names.

- - - -
-
-
-
- - - - - - - - - -- cgit v1.2.3