frp + mqtt 实现嵌入式设备集群管理

frp是用go语言开发的开源内网穿透工具. 分为 frps(服务端,安装在云服务器中),frpc(客户端,安装在内网)
https://github.com/fatedier/frp/releases

frps 服务端 201.165.13.12
配置: frps.ini

[common]
bind_port = 7000
dashboard_port = 7500
token = 123abcDEF456
dashboard_user = admini
dashboard_pwd = admini
vhost_http_port = 8888
vhost_https_port = 1443
subdomain_host = abc.xxx.com

tcp_mux=true
max_pool_count=100

浏览器访问 frps 服务端控制台: 201.165.13.12:7500


frpc 客户端
嵌入式设备1的配置: frpc.ini

[common]
server_addr = 201.165.13.12
server_port = 7000
token = 123abcDEF456
vhost_http_port = 8989
vhost_https_port = 1443

[web_1]
type=http
local_port = 8080
remote_port = 6001
subdomain=111111

use_encryption=true
use_compression=true

嵌入式设备2的配置: frpc.ini

[common]
server_addr = 201.165.13.12
server_port = 7000
token = 123abcDEF456
vhost_http_port = 8989
vhost_https_port = 1443

[web_2]
type=http
local_port = 8080
remote_port = 6002
subdomain=222222

use_encryption=true
use_compression=true

嵌入式设备3的配置: frpc.ini

[common]
server_addr = 201.165.13.12
server_port = 7000
token = 123abcDEF456
vhost_http_port = 8989
vhost_https_port = 1443

[web_3]
type=http
local_port = 8080
remote_port = 6003
subdomain=333333

use_encryption=true
use_compression=true

浏览器访问:
http://111111.abc.xxx.net:8989
http://222222.abc.xxx.net:8989
http://333333.abc.xxx.net:8989

你可能感兴趣的:(mqtt,嵌入式,嵌入式,arm,mqtt)