new: make tunnel service working

This commit is contained in:
Hiddify
2024-02-02 13:47:41 +01:00
parent ad764a86b1
commit 7bdfee5459
14 changed files with 232 additions and 94 deletions

View File

@@ -2,7 +2,9 @@ package main
import (
"fmt"
"time"
"os"
"os/signal"
"syscall"
"github.com/hiddify/libcore/config"
"github.com/hiddify/libcore/global"
@@ -53,6 +55,11 @@ func runSingbox(configPath string) error {
}
go global.StartServiceC(false, configStr)
fmt.Printf("Waiting for 30 seconds\n")
<-time.After(time.Second * 30)
// <-time.After(time.Second * 30)
sigChan := make(chan os.Signal, 1)
signal.Notify(sigChan, os.Interrupt, syscall.SIGTERM)
<-sigChan
return err
}