mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-16 05:00:24 +00:00
Introduce cowboy_req:sock/1 and cowboy_req:cert/1
To obtain the local socket ip/port and the client TLS certificate, respectively.
This commit is contained in:
parent
4090adaecc
commit
ef58e15547
9 changed files with 268 additions and 35 deletions
|
@ -8,14 +8,14 @@ cowboy_req:peer - Peer address and port
|
|||
|
||||
[source,erlang]
|
||||
----
|
||||
peer(Req :: cowboy_req:req()) -> Peer
|
||||
peer(Req :: cowboy_req:req()) -> Info
|
||||
|
||||
Peer :: {inet:ip_address(), inet:port_number()}
|
||||
Info :: {inet:ip_address(), inet:port_number()}
|
||||
----
|
||||
|
||||
Return the peer's IP address and port number.
|
||||
|
||||
The peer can also be obtained using pattern matching:
|
||||
The peer information can also be obtained using pattern matching:
|
||||
|
||||
[source,erlang]
|
||||
----
|
||||
|
@ -56,4 +56,6 @@ way of determining the source of an HTTP request.
|
|||
|
||||
== See also
|
||||
|
||||
link:man:cowboy_req(3)[cowboy_req(3)]
|
||||
link:man:cowboy_req(3)[cowboy_req(3)],
|
||||
link:man:cowboy_req:sock(3)[cowboy_req:sock(3)],
|
||||
link:man:cowboy_req:cert(3)[cowboy_req:cert(3)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue