Browse Source

remove os check

pull/2/head
aler9 5 years ago
parent
commit
7f90724336
  1. 2
      README.md
  2. 17
      main.go

2
README.md

@ -14,7 +14,7 @@ Features: @@ -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

@ -6,7 +6,6 @@ import ( @@ -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 @@ -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{

Loading…
Cancel
Save