From 7ca697a864959c4a4e05344efdaaae529748fdb4 Mon Sep 17 00:00:00 2001 From: lynx Date: Tue, 10 Sep 2024 18:31:56 +0800 Subject: [PATCH] feat: add pprof server --- cmd/main.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmd/main.go b/cmd/main.go index 8589866..7502e86 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -4,6 +4,8 @@ import ( "context" "flag" "log" + "net/http" + _ "net/http/pprof" "github.com/wlynxg/NetHive/core/config" "github.com/wlynxg/NetHive/core/engine" @@ -23,6 +25,10 @@ func parse() *args { func main() { params := parse() + go func() { + http.ListenAndServe(":6060", nil) + }() + cfg, err := config.Load(params.config) if err != nil { log.Fatal(err)