do not listen on IPv6 when host is 0.0.0.0 (#240)

(https://github.com/aler9/mediamtx/issues/1665)
This commit is contained in:
Alessandro Ros
2023-04-10 22:42:19 +02:00
committed by GitHub
parent 9ca5e130fe
commit c56eee37f8
7 changed files with 34 additions and 16 deletions

View File

@@ -322,11 +322,11 @@ func TestClientPlay(t *testing.T) {
clientPorts[i] = inTH.ClientPorts
th.ServerPorts = &[2]int{34556 + i*2, 34557 + i*2}
l1s[i], err = net.ListenPacket("udp", listenIP+":"+strconv.FormatInt(int64(th.ServerPorts[0]), 10))
l1s[i], err = net.ListenPacket("udp", net.JoinHostPort(listenIP, strconv.FormatInt(int64(th.ServerPorts[0]), 10)))
require.NoError(t, err)
defer l1s[i].Close()
l2s[i], err = net.ListenPacket("udp", listenIP+":"+strconv.FormatInt(int64(th.ServerPorts[1]), 10))
l2s[i], err = net.ListenPacket("udp", net.JoinHostPort(listenIP, strconv.FormatInt(int64(th.ServerPorts[1]), 10)))
require.NoError(t, err)
defer l2s[i].Close()