在Docker容器中接收UDP多播 [英] Receive UDP Multicast in Docker Container

查看:215
本文介绍了在Docker容器中接收UDP多播的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在运行节点容器的树莓派上使用docker compose和hypriotos.我想接收发送到本地网络中239.255.255.250:1982的udp组播消息.我的代码正在docker之外的其他机器上工作,所以我认为这是docker问题.

I am using docker compose and hypriotos on a raspberry pi running a node container. I would like to receive udp multicast messages send to 239.255.255.250:1982 in local network. My code is working on other machines outside of docker so I think it's a docker issue.

我已经在docker文件中公开了端口1982/udp,并在docker-compose文件中向端口添加了"1982:1982"和"239.255.255.250:1982:1982/udp".我仍然什么也收不到.我想念什么吗?

I already exposed port 1982/udp in the docker file and in the docker-compose file I added "1982:1982" and "239.255.255.250:1982:1982/udp" to ports. I still can't receive anything. Am I missing something?

我的具体计划是接收来自yeelight的广告消息.这些消息记录在此处

My concrete plan is to receive advertisement messages from a yeelight. These messages are documented here

任何帮助都会很好.谢谢.

Any help would be nice. Thanks.

推荐答案

虽然您可以使用 -p 1982:1982/udp 进行udp,但我不认为docker的端口转发当前支持多播.如果禁用守护程序上的userland代理( dockerd --userland-proxy = false ... ),则可能会比较幸运,但这只是一个猜测.

While you can do udp with -p 1982:1982/udp I don't believe docker's port forwarding currently supports multicast. You may have better luck if you disable the userland proxy on the daemon (dockerd --userland-proxy=false ...), but that's just a guess.

快速/简便的解决方案在消除某些隔离的同时,是通过 docker run --net = host ... 使用主机网络.

The fast/easy solution, while removing some of the isolation, is to use the host network with docker run --net=host ....

这篇关于在Docker容器中接收UDP多播的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆