aboutsummaryrefslogtreecommitdiffstats
path: root/doc/src/manual/ranch_proxy_header.parse.asciidoc
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-11-14 10:55:23 +0100
committerLoïc Hoguin <[email protected]>2018-11-14 10:55:23 +0100
commit2f502078fd0f56e3e61e58f1d57ae15f9f736ffe (patch)
treecd80952cbe2f336a0485535ef82a8c59d49a593d /doc/src/manual/ranch_proxy_header.parse.asciidoc
parent4d0ae7e8c646d00eb868fdee11756b1770a3b976 (diff)
downloadranch-2f502078fd0f56e3e61e58f1d57ae15f9f736ffe.tar.gz
ranch-2f502078fd0f56e3e61e58f1d57ae15f9f736ffe.tar.bz2
ranch-2f502078fd0f56e3e61e58f1d57ae15f9f736ffe.zip
Document the PROXY-related functions; prepare 1.7.0
Diffstat (limited to 'doc/src/manual/ranch_proxy_header.parse.asciidoc')
-rw-r--r--doc/src/manual/ranch_proxy_header.parse.asciidoc49
1 files changed, 49 insertions, 0 deletions
diff --git a/doc/src/manual/ranch_proxy_header.parse.asciidoc b/doc/src/manual/ranch_proxy_header.parse.asciidoc
new file mode 100644
index 0000000..6c22672
--- /dev/null
+++ b/doc/src/manual/ranch_proxy_header.parse.asciidoc
@@ -0,0 +1,49 @@
+= ranch_proxy_header:parse(3)
+
+== Name
+
+ranch_proxy_header:parse - Parse a PROXY protocol header
+
+== Description
+
+[source,erlang]
+----
+parse(Data :: binary())
+ -> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()}
+ | {error, HumanReadable :: atom()}
+----
+
+Parse a PROXY protocol header.
+
+== Arguments
+
+Data::
+
+The PROXY protocol header optionally followed by more data.
+
+== Return value
+
+An `ok` tuple is returned on success, containing the proxy
+information found in the header and the rest of the data
+if more was provided.
+
+An `error` tuple is returned when a protocol error is
+detected. It contains a human readable message about the
+error.
+
+== Changelog
+
+* *1.7*: Function introduced.
+
+== Examples
+
+.Parse the PROXY protocol header
+[source,erlang]
+----
+{ok ProxyInfo, Rest} = ranch_proxy_header:parse(Data).
+----
+
+== See also
+
+link:man:ranch_proxy_header:header(3)[ranch_proxy_header:header(3)],
+link:man:ranch_proxy_header(3)[ranch_proxy_header(3)]