aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/main.go b/main.go
index 8e6befc..f7ad319 100644
--- a/main.go
+++ b/main.go
@@ -103,8 +103,10 @@ type websocketMessage struct {
func main() {
containerPath := ""
httpListenAddress := ""
+ httpPath := ""
flag.StringVar(&containerPath, "container-path", "", "path to the media file you want to playback")
flag.StringVar(&httpListenAddress, "http-listen-address", ":8080", "address for HTTP server to listen on")
+ flag.StringVar(&httpPath, "http-path", "/rtwatch", "URI path prefix")
flag.Parse()
if containerPath == "" {
@@ -135,8 +137,8 @@ func main() {
pipeline = gst.CreatePipeline(containerPath, audioTrack, videoTrack)
pipeline.Start()
- http.HandleFunc("/", serveHome)
- http.HandleFunc("/ws", serveWs)
+ http.HandleFunc(httpPath, serveHome)
+ http.HandleFunc(httpPath + "/ws/", serveWs)
fmt.Println(fmt.Sprintf("Video file '%s' is now available on '%s', have fun!", containerPath, httpListenAddress))
log.Fatal(http.ListenAndServe(httpListenAddress, nil))