Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc(mqtt-proxy): how to enable. #916

Merged
merged 1 commit into from
Nov 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion doc/plugins/mqtt-proxy-cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 )两个协议

## 属性

Expand All @@ -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
Expand Down
19 changes: 18 additions & 1 deletion doc/plugins/mqtt-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
Expand Down