Explorar o código

Add proxy_protocol, proxy_protocol_timeout options for ws/wss

Feng Lee %!s(int64=8) %!d(string=hai) anos
pai
achega
d5222dcc9b
Modificáronse 2 ficheiros con 24 adicións e 4 borrados
  1. 8 0
      etc/emq.conf
  2. 16 4
      priv/emq.schema

+ 8 - 0
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
 

+ 16 - 4
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}