mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-24 15:02:32 +00:00
Add default redirect for profiling when enabled.
This commit adds a simple 303 redirect for the root of profile server so launching it without a path automatically goes to the debug profiling page.
This commit is contained in:
parent
7846b2f4e2
commit
cc6cfdad9e
3
btcd.go
3
btcd.go
@ -48,6 +48,9 @@ func btcdMain() error {
|
|||||||
go func() {
|
go func() {
|
||||||
listenAddr := net.JoinHostPort("", cfg.Profile)
|
listenAddr := net.JoinHostPort("", cfg.Profile)
|
||||||
log.Infof("Profile server listening on %s", listenAddr)
|
log.Infof("Profile server listening on %s", listenAddr)
|
||||||
|
profileRedirect := http.RedirectHandler("/debug/pprof",
|
||||||
|
http.StatusSeeOther)
|
||||||
|
http.Handle("/", profileRedirect)
|
||||||
log.Errorf("%v", http.ListenAndServe(listenAddr, nil))
|
log.Errorf("%v", http.ListenAndServe(listenAddr, nil))
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user