remove os check

This commit is contained in:
aler9 2020-02-16 13:08:54 +01:00
parent 3617e544c9
commit 7f90724336
2 changed files with 1 additions and 18 deletions

View File

@ -14,7 +14,7 @@ Features:
* Each stream can have multiple video and audio tracks
* Supports the RTP/RTCP streaming protocol
* Optional authentication mechanism for publishers
* Optionally run a script on client connect or disconnect (currently Linux only)
* Run a script when a client connects or disconnects
* Compatible with Linux and Windows, does not require any dependency or interpreter, it's a single executable
## Installation

17
main.go
View File

@ -6,7 +6,6 @@ import (
"net"
"os"
"regexp"
"runtime"
"strings"
"sync"
"time"
@ -109,22 +108,6 @@ func newProgram(protocolsStr string, rtspPort int, rtpPort int, rtcpPort int, pu
}
}
if preScript != "" {
if runtime.GOOS != "linux" {
return nil, fmt.Errorf("connect script currenty supported only on Linux")
} else if !regexp.MustCompile(`(?m)^(.+)\/([^/]+)$`).MatchString(preScript) {
return nil, fmt.Errorf("connect script must be a valid path")
}
}
if postScript != "" {
if runtime.GOOS != "linux" {
return nil, fmt.Errorf("disconnect script currently supported only on Linux")
} else if !regexp.MustCompile(`(?m)^(.+)\/([^/]+)$`).MatchString(postScript) {
return nil, fmt.Errorf("disconnect script must be a valid path")
}
}
log.Printf("rtsp-simple-server %s", Version)
p := &program{