From d5222dcc9b79fd47626cacaf75f8ae38f465dce1 Mon Sep 17 00:00:00 2001 From: Feng Lee Date: Mon, 25 Dec 2017 20:38:09 +0800 Subject: [PATCH] Add proxy_protocol, proxy_protocol_timeout options for ws/wss --- etc/emq.conf | 8 ++++++++ priv/emq.schema | 20 ++++++++++++++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/etc/emq.conf b/etc/emq.conf index 2698da935..db62e1d49 100644 --- a/etc/emq.conf +++ b/etc/emq.conf @@ -511,6 +511,10 @@ listener.ws.external.max_clients = 64 listener.ws.external.access.1 = allow all +## Proxy Protocol V1/2 +## listener.ws.external.proxy_protocol = on +## listener.ws.external.proxy_protocol_timeout = 3s + ## TCP Options listener.ws.external.backlog = 1024 @@ -537,6 +541,10 @@ listener.wss.external.max_clients = 64 listener.wss.external.access.1 = allow all +## Proxy Protocol V1/2 +## listener.wss.external.proxy_protocol = on +## listener.wss.external.proxy_protocol_timeout = 3s + ## SSL Options listener.wss.external.handshake_timeout = 15s diff --git a/priv/emq.schema b/priv/emq.schema index 73d8d2e3a..aaefce4c2 100644 --- a/priv/emq.schema +++ b/priv/emq.schema @@ -795,12 +795,10 @@ end}. ]}. {mapping, "listener.tcp.$name.proxy_protocol", "emqttd.listeners", [ - %%{default, off}, {datatype, flag} ]}. {mapping, "listener.tcp.$name.proxy_protocol_timeout", "emqttd.listeners", [ - %%{default, "5s"}, {datatype, {duration, ms}} ]}. @@ -883,12 +881,10 @@ end}. ]}. {mapping, "listener.ssl.$name.proxy_protocol", "emqttd.listeners", [ - %%{default, off}, {datatype, flag} ]}. {mapping, "listener.ssl.$name.proxy_protocol_timeout", "emqttd.listeners", [ - %%{default, "5s"}, {datatype, {duration, ms}} ]}. @@ -1015,6 +1011,14 @@ end}. {datatype, string} ]}. +{mapping, "listener.ws.$name.proxy_protocol", "emqttd.listeners", [ + {datatype, flag} +]}. + +{mapping, "listener.ws.$name.proxy_protocol_timeout", "emqttd.listeners", [ + {datatype, {duration, ms}} +]}. + {mapping, "listener.ws.$name.backlog", "emqttd.listeners", [ {default, 1024}, {datatype, integer} @@ -1088,6 +1092,14 @@ end}. {datatype, string} ]}. +{mapping, "listener.wss.$name.proxy_protocol", "emqttd.listeners", [ + {datatype, flag} +]}. + +{mapping, "listener.wss.$name.proxy_protocol_timeout", "emqttd.listeners", [ + {datatype, {duration, ms}} +]}. + {mapping, "listener.wss.$name.backlog", "emqttd.listeners", [ {default, 1024}, {datatype, integer}