fix: bugs and issues

This commit is contained in:
Hiddify
2024-03-09 21:07:15 +01:00
parent d05deef499
commit 8ecd0d9644
13 changed files with 79 additions and 60 deletions

View File

@@ -21,6 +21,7 @@ const (
func StartWebServer(Port int, TLS bool) {
http.HandleFunc("/start", startHandler)
http.HandleFunc("/stop", StopHandler)
http.HandleFunc("/status", StatusHandler)
http.HandleFunc("/exit", ExitHandler)
server := &http.Server{
Addr: "127.0.0.1:" + fmt.Sprintf("%d", Port),
@@ -85,6 +86,8 @@ func startHandler(w http.ResponseWriter, r *http.Request) {
}
http.Error(w, fmt.Sprintf("Ok"), http.StatusOK)
}
func StatusHandler(w http.ResponseWriter, r *http.Request) {
}
func StopHandler(w http.ResponseWriter, r *http.Request) {
err := global.StopServiceC()
if err != nil {