diff options
Diffstat (limited to 'docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html')
-rw-r--r-- | docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html | 97 |
1 files changed, 25 insertions, 72 deletions
diff --git a/docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html b/docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html index 46d2262b..f9ec4efb 100644 --- a/docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html +++ b/docs/en/cowboy/2.3/manual/cowboy_req.peer/index.html @@ -62,98 +62,51 @@ <h1 class="lined-header"><span>cowboy_req:peer(3)</span></h1> -<div class="sect1"> <h2 id="_name">Name</h2> -<div class="sectionbody"> -<div class="paragraph"><p>cowboy_req:peer - Peer address and port</p></div> -</div> -</div> -<div class="sect1"> +<p>cowboy_req:peer - Peer address and port</p> <h2 id="_description">Description</h2> -<div class="sectionbody"> -<div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><tt><span style="font-weight: bold"><span style="color: #000000">peer</span></span>(<span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>()) <span style="color: #990000">-></span> <span style="color: #009900">Info</span> +<pre><tt><b><font color="#000000">peer</font></b>(<font color="#009900">Req</font> <font color="#990000">::</font> <b><font color="#000000">cowboy_req:req</font></b>()) <font color="#990000">-></font> <font color="#009900">Info</font> -<span style="color: #009900">Info</span> <span style="color: #990000">::</span> {<span style="font-weight: bold"><span style="color: #000000">inet:ip_address</span></span>(), <span style="font-weight: bold"><span style="color: #000000">inet:port_number</span></span>()}</tt></pre></div></div> -<div class="paragraph"><p>Return the peer’s IP address and port number.</p></div> -<div class="paragraph"><p>The peer information can also be obtained using pattern matching:</p></div> -<div class="listingblock"> -<div class="content"><!-- Generator: GNU source-highlight +<font color="#009900">Info</font> <font color="#990000">::</font> {<b><font color="#000000">inet:ip_address</font></b>(), <b><font color="#000000">inet:port_number</font></b>()}</tt></pre> +</div></div> +<p>Return the peer's IP address and port number.</p> +<p>The peer information can also be obtained using pattern matching:</p> +<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><tt>#{<span style="color: #FF6600">peer</span> <span style="color: #990000">:=</span> {<span style="color: #009900">IP</span>, <span style="color: #009900">Port</span>}} <span style="color: #990000">=</span> <span style="color: #009900">Req</span><span style="color: #990000">.</span></tt></pre></div></div> -</div> -</div> -<div class="sect1"> +<pre><tt>#{<font color="#FF6600">peer</font> <font color="#990000">:=</font> {<font color="#009900">IP</font>, <font color="#009900">Port</font>}} <font color="#990000">=</font> <font color="#009900">Req</font><font color="#990000">.</font></tt></pre> +</div></div> <h2 id="_arguments">Arguments</h2> -<div class="sectionbody"> -<div class="dlist"><dl> -<dt class="hdlist1"> -Req -</dt> -<dd> -<p> -The Req object. -</p> +<dl><dt>Req</dt> +<dd><p>The Req object.</p> </dd> -</dl></div> -</div> -</div> -<div class="sect1"> +</dl> <h2 id="_return_value">Return value</h2> -<div class="sectionbody"> -<div class="paragraph"><p>The peer’s IP address and port number.</p></div> -<div class="paragraph"><p>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.</p></div> -<div class="paragraph"><p>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.</p></div> -</div> -</div> -<div class="sect1"> +<p>The peer's IP address and port number.</p> +<p>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.</p> +<p>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.</p> <h2 id="_changelog">Changelog</h2> -<div class="sectionbody"> -<div class="ulist"><ul> -<li> -<p> -<strong>2.0</strong>: Only the peer is returned, it is no longer wrapped in a tuple. -</p> +<ul><li><strong>2.0</strong>: Only the peer is returned, it is no longer wrapped in a tuple. </li> -<li> -<p> -<strong>1.0</strong>: Function introduced. -</p> +<li><strong>1.0</strong>: Function introduced. </li> -</ul></div> -</div> -</div> -<div class="sect1"> +</ul> <h2 id="_examples">Examples</h2> -<div class="sectionbody"> -<div class="listingblock"> -<div class="title">Get the peer IP address and port number.</div> -<div class="content"><!-- Generator: GNU source-highlight +<div class="listingblock"><div class="title">Get the peer IP address and port number.</div> +<div class="content"><!-- Generator: GNU source-highlight 3.1.8 by Lorenzo Bettini http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> -<pre><tt>{<span style="color: #009900">IP</span>, <span style="color: #009900">Port</span>} <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:peer</span></span>(<span style="color: #009900">Req</span>)<span style="color: #990000">.</span></tt></pre></div></div> -</div> -</div> -<div class="sect1"> +<pre><tt>{<font color="#009900">IP</font>, <font color="#009900">Port</font>} <font color="#990000">=</font> <b><font color="#000000">cowboy_req:peer</font></b>(<font color="#009900">Req</font>)<font color="#990000">.</font></tt></pre> +</div></div> <h2 id="_see_also">See also</h2> -<div class="sectionbody"> -<div class="paragraph"><p><a href="../cowboy_req">cowboy_req(3)</a>, -<a href="../cowboy_req.sock">cowboy_req:sock(3)</a>, -<a href="../cowboy_req.cert">cowboy_req:cert(3)</a></p></div> -</div> -</div> +<p><a href="../cowboy_req">cowboy_req(3)</a>, <a href="../cowboy_req.sock">cowboy_req:sock(3)</a>, <a href="../cowboy_req.cert">cowboy_req:cert(3)</a></p> + |