Add stop platform command

This commit is contained in:
世界
2023-03-04 00:40:47 +08:00
parent b9b2b77814
commit dd0a07624e
5 changed files with 56 additions and 3 deletions

View File

@@ -3,7 +3,6 @@ package libbox
import (
"context"
"net/netip"
"runtime"
"syscall"
"github.com/sagernet/sing-box"
@@ -28,7 +27,6 @@ func NewService(configContent string, platformInterface PlatformInterface) (*Box
if err != nil {
return nil, err
}
platformInterface.WriteLog("Hello " + runtime.GOOS + "/" + runtime.GOARCH)
ctx, cancel := context.WithCancel(context.Background())
instance, err := box.New(ctx, options, &platformInterfaceWrapper{platformInterface, platformInterface.UseProcFS()})
if err != nil {