From 92b54aacc0de5446dd5497c39897b0bbff72e626 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 13 Jun 2018 09:54:12 +0200 Subject: Rebuild using Asciideck --- .../cowboy/2.0/manual/cowboy_req.peer/index.html | 95 ++++++---------------- 1 file changed, 25 insertions(+), 70 deletions(-) (limited to 'docs/en/cowboy/2.0/manual/cowboy_req.peer/index.html') diff --git a/docs/en/cowboy/2.0/manual/cowboy_req.peer/index.html b/docs/en/cowboy/2.0/manual/cowboy_req.peer/index.html index 40433281..010c02f5 100644 --- a/docs/en/cowboy/2.0/manual/cowboy_req.peer/index.html +++ b/docs/en/cowboy/2.0/manual/cowboy_req.peer/index.html @@ -62,96 +62,51 @@

cowboy_req:peer(3)

-

Name

-
-

cowboy_req:peer - Peer address and port

-
-
-
+

cowboy_req:peer - Peer address and port

Description

-
-
-
-
peer(Req :: cowboy_req:req()) -> Peer
+
peer(Req :: cowboy_req:req()) -> Peer
 
-Peer :: {inet:ip_address(), inet:port_number()}
-

Return the peer’s IP address and port number.

-

The peer can also be obtained using pattern matching:

-
-
-
#{peer := {IP, Port}} = Req.
-
-
-
+
#{peer := {IP, Port}} = Req.
+

Arguments

-
-
-
-Req -
-
-

-The Req object. -

+
Req
+

The Req object.

-
-
- -
+

Return value

-
-

The peer’s IP address and port number.

-

The peer is not necessarily the client’s IP address and port. -It is the IP address of the endpoint connecting directly to -the server, which may be a gateway or a proxy.

-

The forwarded header can be used to get better information -about the different endpoints from the client to the server. -Note however that it is only informative; there is no reliable -way of determining the source of an HTTP request.

-
-
-
+

The peer's IP address and port number.

+

The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy.

+

The forwarded header can be used to get better information about the different endpoints from the client to the server. Note however that it is only informative; there is no reliable way of determining the source of an HTTP request.

Changelog

-
-
    -
  • -

    -2.0: Only the peer is returned, it is no longer wrapped in a tuple. -

    +
    • 2.0: Only the peer is returned, it is no longer wrapped in a tuple.
    • -
    • -

      -1.0: Function introduced. -

      +
    • 1.0: Function introduced.
    • -
-
-
-
+

Examples

-
-
-
Get the peer IP address and port number.
-
-
{IP, Port} = cowboy_req:peer(Req).
-
-
-
+
{IP, Port} = cowboy_req:peer(Req).
+

See also

- - +

cowboy_req(3)

+ -- cgit v1.2.3