mirror of
https://github.com/SagerNet/sing-box.git
synced 2024-11-10 02:53:12 +00:00
Improve cmd
This commit is contained in:
parent
ecaddd897e
commit
e05ee55545
|
@ -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) {
|
||||
|
|
|
@ -18,6 +18,7 @@ var commandFormat = &cobra.Command{
|
|||
Use: "format",
|
||||
Short: "Format configuration",
|
||||
Run: formatConfiguration,
|
||||
Args: cobra.NoArgs,
|
||||
}
|
||||
|
||||
func init() {
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
}()
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue