Remove all listeners from IPv6 interface
This commit is contained in:
+1
-1
@@ -44,7 +44,7 @@ func NewServer(name string) *Server {
|
||||
|
||||
func (s *Server) Serve(address string) (err error) {
|
||||
var ln net.Listener
|
||||
if ln, err = net.Listen("tcp", address); err != nil {
|
||||
if ln, err = net.Listen("tcp4", address); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ import (
|
||||
func TestTimeout(t *testing.T) {
|
||||
Timeout = time.Millisecond
|
||||
|
||||
ln, err := net.Listen("tcp", "localhost:0")
|
||||
ln, err := net.Listen("tcp4", "localhost:0")
|
||||
require.Nil(t, err)
|
||||
|
||||
client := NewClient("rtsp://" + ln.Addr().String() + "/stream")
|
||||
@@ -27,7 +27,7 @@ func TestTimeout(t *testing.T) {
|
||||
func TestMissedControl(t *testing.T) {
|
||||
Timeout = time.Millisecond
|
||||
|
||||
ln, err := net.Listen("tcp", "localhost:0")
|
||||
ln, err := net.Listen("tcp4", "localhost:0")
|
||||
require.Nil(t, err)
|
||||
|
||||
go func() {
|
||||
|
||||
+2
-2
@@ -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