Ideally the flag to enable the profiler would be a string so the admin can specify the endpoint, but if using a bool it should listen on loopback interfaces only.
|
if opts.HTTPProfile { |
|
log.Warnf("Starting the HTTP profiler on path /debug/pprof/.") |
|
// http pprof uses http.DefaultServeMux |
|
http.Handle("/", http.RedirectHandler("/debug/pprof/", http.StatusSeeOther)) |
|
go func() { |
|
if err := http.ListenAndServe(":9232", nil); err != nil { |
|
log.Errorf("ListenAndServe failed for http/pprof: %v", err) |
|
} |
|
}() |
|
} |
Ideally the flag to enable the profiler would be a string so the admin can specify the endpoint, but if using a bool it should listen on loopback interfaces only.
dcrdex/server/cmd/dcrdex/main.go
Lines 72 to 81 in 7789513