Glimesh / broadcast-box

A broadcast, in a box.
MIT License
1.46k stars 83 forks source link

Tries to listen on IPv6 for UDP preventing the program to start #199

Open qdm12 opened 1 month ago

qdm12 commented 1 month ago

On containers not having IPv6 (i.e. my Docker setup does not have ipv6 setup), I get the logs:

2024/10/20 08:06:29 Loading `.env.production`
2024/10/20 08:06:29 listen udp [fe80::42:aff:fe00:25%eth0]:8542: bind: cannot assign requested address

The UDP server tries to listen on an ipv6 address but fails; my container ip a output is:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
1174: eth0@if1175: <BROADCAST,MULTICAST,UP,LOWER_UP,M-DOWN> mtu 1500 qdisc noqueue state UP 
    link/ether 02:42:ac:11:00:03 brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.3/16 brd 172.17.255.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::42:acff:fe11:3/64 scope link tentative 
       valid_lft forever preferred_lft forever

It would be nice to give the option to choose the ip family to bind to (all, v4, v6) especially for the udp server which does not have a listening address option for now.