diff --git a/doc/plugins/mqtt-proxy-cn.md b/doc/plugins/mqtt-proxy-cn.md index 12e59150fcff..287fc317aee2 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 ca5f1dc46c90..fb0abe234c1d 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