【发布时间】:2021-03-18 15:38:10
【问题描述】:
我正在尝试在 docker 容器中设置 mqtt 代理。我在我的机器上提取了以下 docker 镜像 (https://hub.docker.com/_/eclipse-mosquitto),我可以使用以下命令成功启动 docker 容器:
docker run -it -p 1883:1883 -p 9001:9001 --network=host eclipse-mosquitto
如果我使用该命令运行它,我会得到以下输出:
WARNING: Published ports are discarded when using host network mode
1616081533: mosquitto version 2.0.9 starting
1616081533: Config loaded from /mosquitto/config/mosquitto.conf.
1616081533: Starting in local only mode. Connections will only be possible from clients running on this machine.
1616081533: Create a configuration file which defines a listener to allow remote access.
1616081533: Opening ipv4 listen socket on port 1883.
1616081533: Opening ipv6 listen socket on port 1883.
1616081533: mosquitto version 2.0.9 running
然后我启动 Mqqtfx 并设置到 127.0.0.1 和端口 1883 的连接,但 mqtt 客户端无法连接到我的代理。我做错了什么?
提前致谢!
【问题讨论】: