mirror of
https://github.com/gen2brain/cam2ip.git
synced 2026-07-28 15:49:19 +00:00
Add --lazy to open the camera only while clients are connected, issue #21
This commit is contained in:
@@ -36,7 +36,8 @@ type Server struct {
|
||||
Bind string
|
||||
Htpasswd string
|
||||
|
||||
Reader handlers.ImageReader
|
||||
Lazy bool
|
||||
Open func() (handlers.ImageReader, error)
|
||||
}
|
||||
|
||||
// NewServer returns new Server.
|
||||
@@ -54,7 +55,7 @@ func (s *Server) ListenAndServe() error {
|
||||
basic = auth.NewBasicAuthenticator(realm, auth.HtpasswdFileProvider(s.Htpasswd))
|
||||
}
|
||||
|
||||
stream := handlers.NewStream(s.Reader, s.Delay, s.Quality)
|
||||
stream := handlers.NewStream(s.Open, s.Delay, s.Quality, s.Lazy)
|
||||
|
||||
mux := http.NewServeMux()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user