mirror of
				https://github.com/AlexxIT/go2rtc.git
				synced 2025-10-31 19:53:02 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			28 lines
		
	
	
		
			529 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			529 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package debug
 | |
| 
 | |
| import (
 | |
| 	"github.com/AlexxIT/go2rtc/cmd/api"
 | |
| 	"github.com/AlexxIT/go2rtc/cmd/streams"
 | |
| 	"github.com/AlexxIT/go2rtc/pkg/streamer"
 | |
| 	"net/http"
 | |
| 	"os"
 | |
| 	"strconv"
 | |
| )
 | |
| 
 | |
| func Init() {
 | |
| 	api.HandleFunc("api/stack", stackHandler)
 | |
| 	api.HandleFunc("api/exit", exitHandler)
 | |
| 
 | |
| 	streams.HandleFunc("null", nullHandler)
 | |
| }
 | |
| 
 | |
| func exitHandler(_ http.ResponseWriter, r *http.Request) {
 | |
| 	s := r.URL.Query().Get("code")
 | |
| 	code, _ := strconv.Atoi(s)
 | |
| 	os.Exit(code)
 | |
| }
 | |
| 
 | |
| func nullHandler(string) (streamer.Producer, error) {
 | |
| 	return nil, nil
 | |
| }
 | 
