From 48f39402181d959cad88cb3f460210c007169f50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 12 May 2021 11:13:47 +0200 Subject: Cowboy 2.9.0 --- .../manual/ranch_proxy_header.header/index.html | 220 +++++++++++++++++++++ 1 file changed, 220 insertions(+) create mode 100644 docs/en/ranch/1.8/manual/ranch_proxy_header.header/index.html (limited to 'docs/en/ranch/1.8/manual/ranch_proxy_header.header/index.html') diff --git a/docs/en/ranch/1.8/manual/ranch_proxy_header.header/index.html b/docs/en/ranch/1.8/manual/ranch_proxy_header.header/index.html new file mode 100644 index 00000000..a8d3e9d0 --- /dev/null +++ b/docs/en/ranch/1.8/manual/ranch_proxy_header.header/index.html @@ -0,0 +1,220 @@ + + + + + + + + + + Nine Nines: ranch_proxy_header:header(3) + + + + + + + + + + + + + + + + +
+
+
+
+ +

ranch_proxy_header:header(3)

+ +

Name

+

ranch_proxy_header:header - Build a PROXY protocol header

+

Description

+
+
header(ProxyInfo)            -> header(ProxyInfo, #{})
+header(ProxyInfo, BuildOpts) -> iodata()
+
+ProxyInfo :: ranch_proxy_header:proxy_info()
+BuildOpts :: #{
+    checksum => crc32c,
+    padding  => pos_integer() %% >= 3
+}
+
+

Build a PROXY protocol header.

+

Arguments

+
ProxyInfo
+

The proxy information to encode.

+
+
BuildOpts
+

Options to control whether to add a checksum or padding should be included in the encoded PROXY protocol header.

+
+
+

Return value

+

The PROXY protocol header is returned.

+

Changelog

+
  • 1.7: Function introduced. +
  • +
+

Examples

+
Build a PROXY protocol header
+
+
ProxyInfo = #{
+    version => 2,
+    command => proxy,
+
+    transport_family   => ipv4,
+    transport_protocol => stream,
+
+    src_address  => {192, 168, 1, 11},
+    src_port     => 54321,
+    dest_address => {192, 168, 1, 42},
+    dest_port    => 443
+},
+Data = ranch_proxy_header:parse(ProxyInfo).
+
+
Build a PROXY protocol header with checksum and padding
+
+
Data = ranch_proxy_header:parse(ProxyInfo, #{
+    checksum => crc32c,
+    padding  => 7
+}).
+
+

See also

+

ranch_proxy_header:header(3), ranch_proxy_header(3)

+ + + + + + +
+ +
+ + +

+ Ranch + 1.8 + 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