Ver código fonte

Add proxy_protocol, proxy_protocol_timeout options for ws/wss

Feng Lee 8 anos atrás
pai
commit
d5222dcc9b
2 arquivos alterados com 24 adições e 4 exclusões
  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
 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
 ## TCP Options
 listener.ws.external.backlog = 1024
 listener.ws.external.backlog = 1024
 
 
@@ -537,6 +541,10 @@ listener.wss.external.max_clients = 64
 
 
 listener.wss.external.access.1 = allow all
 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
 ## SSL Options
 listener.wss.external.handshake_timeout = 15s
 listener.wss.external.handshake_timeout = 15s
 
 

+ 16 - 4
priv/emq.schema

@@ -795,12 +795,10 @@ end}.
 ]}.
 ]}.
 
 
 {mapping, "listener.tcp.$name.proxy_protocol", "emqttd.listeners", [
 {mapping, "listener.tcp.$name.proxy_protocol", "emqttd.listeners", [
-  %%{default, off},
   {datatype, flag}
   {datatype, flag}
 ]}.
 ]}.
 
 
 {mapping, "listener.tcp.$name.proxy_protocol_timeout", "emqttd.listeners", [
 {mapping, "listener.tcp.$name.proxy_protocol_timeout", "emqttd.listeners", [
-  %%{default, "5s"},
   {datatype, {duration, ms}}
   {datatype, {duration, ms}}
 ]}.
 ]}.
 
 
@@ -883,12 +881,10 @@ end}.
 ]}.
 ]}.
 
 
 {mapping, "listener.ssl.$name.proxy_protocol", "emqttd.listeners", [
 {mapping, "listener.ssl.$name.proxy_protocol", "emqttd.listeners", [
-  %%{default, off},
   {datatype, flag}
   {datatype, flag}
 ]}.
 ]}.
 
 
 {mapping, "listener.ssl.$name.proxy_protocol_timeout", "emqttd.listeners", [
 {mapping, "listener.ssl.$name.proxy_protocol_timeout", "emqttd.listeners", [
-  %%{default, "5s"},
   {datatype, {duration, ms}}
   {datatype, {duration, ms}}
 ]}.
 ]}.
 
 
@@ -1015,6 +1011,14 @@ end}.
   {datatype, string}
   {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", [
 {mapping, "listener.ws.$name.backlog", "emqttd.listeners", [
   {default, 1024},
   {default, 1024},
   {datatype, integer}
   {datatype, integer}
@@ -1088,6 +1092,14 @@ end}.
   {datatype, string}
   {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", [
 {mapping, "listener.wss.$name.backlog", "emqttd.listeners", [
   {default, 1024},
   {default, 1024},
   {datatype, integer}
   {datatype, integer}