mirror of
https://github.com/AlexxIT/go2rtc.git
synced 2025-10-05 08:16:55 +08:00
Remove all listeners from IPv6 interface
This commit is contained in:
@@ -50,13 +50,13 @@ func NewAPI(address string) (*webrtc.API, error) {
|
||||
if address != "" {
|
||||
address, network, _ := strings.Cut(address, "/")
|
||||
if network == "" || network == "udp" {
|
||||
if ln, err := net.ListenPacket("udp", address); err == nil {
|
||||
if ln, err := net.ListenPacket("udp4", address); err == nil {
|
||||
udpMux := webrtc.NewICEUDPMux(nil, ln)
|
||||
s.SetICEUDPMux(udpMux)
|
||||
}
|
||||
}
|
||||
if network == "" || network == "tcp" {
|
||||
if ln, err := net.Listen("tcp", address); err == nil {
|
||||
if ln, err := net.Listen("tcp4", address); err == nil {
|
||||
tcpMux := webrtc.NewICETCPMux(nil, ln, 8)
|
||||
s.SetICETCPMux(tcpMux)
|
||||
}
|
||||
|
Reference in New Issue
Block a user