You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by we...@apache.org on 2019/11/29 00:55:09 UTC

[incubator-apisix] branch master updated: doc: how to enable mqtt-proxy plugin. (#916)

This is an automated email from the ASF dual-hosted git repository.

wenming pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-apisix.git


The following commit(s) were added to refs/heads/master by this push:
     new 4eaf3ca  doc: how to enable mqtt-proxy plugin. (#916)
4eaf3ca is described below

commit 4eaf3cae291056a650c1c3383a893c4efd1c673f
Author: YuanSheng Wang <me...@gmail.com>
AuthorDate: Fri Nov 29 08:54:59 2019 +0800

    doc: how to enable mqtt-proxy plugin. (#916)
---
 doc/plugins/mqtt-proxy-cn.md | 18 +++++++++++++++++-
 doc/plugins/mqtt-proxy.md    | 19 ++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/doc/plugins/mqtt-proxy-cn.md b/doc/plugins/mqtt-proxy-cn.md
index 12e5915..287fc31 100644
--- a/doc/plugins/mqtt-proxy-cn.md
+++ b/doc/plugins/mqtt-proxy-cn.md
@@ -30,7 +30,7 @@
 
 `mqtt-proxy` 只工作在流模式,它可以帮助你根据 MQTT 的 `client_id` 实现动态负载均衡。
 
-这个插件都支持 MQTT [3.1.* ]( http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html )及[5.0]( https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html )。
+这个插件支持 MQTT [3.1.* ]( http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html )及[5.0]( https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html )两个协议。
 
 ## 属性
 
@@ -41,6 +41,22 @@
 
 ## 如何启用
 
+为了启用该插件,需要先在 `conf/config.yaml` 中首先开启 stream_proxy 配置,比如下面配置代表监听 9100 TCP 端口:
+
+```yaml
+    ...
+    router:
+        http: 'radixtree_uri'
+        ssl: 'radixtree_sni'
+    stream_proxy:                 # TCP/UDP proxy
+      tcp:                        # TCP proxy port list
+        - 9100
+    dns_resolver:
+    ...
+```
+
+然后把 MQTT 请求发送到 9100 端口即可。
+
 下面是一个示例,在指定的 route 上开启了 mqtt-proxy 插件:
 
 ```shell
diff --git a/doc/plugins/mqtt-proxy.md b/doc/plugins/mqtt-proxy.md
index ca5f1dc..fb0abe2 100644
--- a/doc/plugins/mqtt-proxy.md
+++ b/doc/plugins/mqtt-proxy.md
@@ -32,7 +32,7 @@
 The plugin `mqtt-proxy` only works in stream model, it help you to dynamic load
 balance by `client_id` of MQTT.
 
-And this plugin both support MQTT [3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) and [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
+And this plugin both support MQTT protocol [3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v3.1.1/os/mqtt-v3.1.1-os.html) and [5.0](https://docs.oasis-open.org/mqtt/mqtt/v5.0/mqtt-v5.0.html).
 
 ## Attributes
 
@@ -46,6 +46,23 @@ And this plugin both support MQTT [3.1.*](http://docs.oasis-open.org/mqtt/mqtt/v
 
 ## How To Enable
 
+To enable this plugin, we need to enable the stream_proxy configuration in `conf/config.yaml` first.
+For example, the following configuration represents listening on the 9100 TCP port.
+
+```yaml
+    ...
+    router:
+        http: 'radixtree_uri'
+        ssl: 'radixtree_sni'
+    stream_proxy:                 # TCP/UDP proxy
+      tcp:                        # TCP proxy port list
+        - 9100
+    dns_resolver:
+    ...
+```
+
+Then send the MQTT request to port 9100.
+
 Creates a stream route, and enable plugin `mqtt-proxy`.
 
 ```shell