1
0
Fork 0
mirror of https://github.com/apernet/hysteria.git synced 2025-04-06 14:07:39 +03:00

feat: pprof

This commit is contained in:
tobyxdd 2023-08-05 12:07:22 -07:00
parent 3b4af8035b
commit 531b23baa4
3 changed files with 39 additions and 8 deletions

22
app/pprof.go Normal file
View file

@ -0,0 +1,22 @@
//go:build pprof
package main
import (
"fmt"
"net/http"
_ "net/http/pprof"
)
const (
pprofListenAddr = ":6060"
)
func init() {
fmt.Printf("!!! pprof enabled, listening on %s\n", pprofListenAddr)
go func() {
if err := http.ListenAndServe(pprofListenAddr, nil); err != nil {
panic(err)
}
}()
}