Improve cmd

This commit is contained in:
世界 2022-08-09 14:49:17 +08:00
parent ecaddd897e
commit e05ee55545
No known key found for this signature in database
GPG key ID: CD109927C34A63C4
4 changed files with 11 additions and 1 deletions

View file

@ -16,6 +16,7 @@ var commandCheck = &cobra.Command{
Use: "check",
Short: "Check configuration",
Run: checkConfiguration,
Args: cobra.NoArgs,
}
func checkConfiguration(cmd *cobra.Command, args []string) {

View file

@ -18,6 +18,7 @@ var commandFormat = &cobra.Command{
Use: "format",
Short: "Format configuration",
Run: formatConfiguration,
Args: cobra.NoArgs,
}
func init() {

View file

@ -14,6 +14,7 @@ var commandVersion = &cobra.Command{
Use: "version",
Short: "Print current version of sing-box",
Run: printVersion,
Args: cobra.NoArgs,
}
func printVersion(cmd *cobra.Command, args []string) {

View file

@ -5,8 +5,15 @@ package main
import (
"net/http"
_ "net/http/pprof"
"github.com/sagernet/sing-box/log"
)
func init() {
go http.ListenAndServe("0.0.0.0:8964", nil)
go func() {
err := http.ListenAndServe("0.0.0.0:8964", nil)
if err != nil {
log.Debug(err)
}
}()
}