Receive UDP Multicast in Docker Container

耗尽温柔 提交于 2021-01-04 05:52:07

问题


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.

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?

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

Any help would be nice. Thanks.


回答1:


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.

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



来源:https://stackoverflow.com/questions/42422406/receive-udp-multicast-in-docker-container

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!