Add command server

This commit is contained in:
problematicconsumer
2023-08-28 13:07:21 +03:30
parent c7fae3d09b
commit cb1d08734a
3 changed files with 18 additions and 3 deletions

16
custom/command_server.go Normal file
View File

@@ -0,0 +1,16 @@
package main
import "github.com/sagernet/sing-box/experimental/libbox"
var commandServer *libbox.CommandServer
type CommandServerHandler struct{}
func (csh *CommandServerHandler) ServiceReload() error {
return nil
}
func startCommandServer() error {
commandServer = libbox.NewCommandServer(&CommandServerHandler{}, 300)
return commandServer.Start()
}