Skip to content

Commit

Permalink
Merge pull request #3356 from getlantern/issue3291
Browse files Browse the repository at this point in the history
add pprofaddr option resolves #3291
  • Loading branch information
myleshorton committed Dec 17, 2015
2 parents 4be4fe1 + dc5131f commit 83fd0c5
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/github.com/getlantern/flashlight/flashlight.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"math/rand"
"net"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"runtime"
Expand Down Expand Up @@ -51,6 +52,7 @@ var (
headless = flag.Bool("headless", false, "if true, lantern will run with no ui")
startup = flag.Bool("startup", false, "if true, Lantern was automatically run on system startup")
clearProxySettings = flag.Bool("clear-proxy-settings", false, "if true, Lantern removes proxy settings from the system.")
pprofAddr = flag.String("pprofaddr", "", "pprof address to listen on, not activate pprof if empty")

showui = true

Expand Down Expand Up @@ -128,6 +130,15 @@ func main() {

parseFlags()

if *pprofAddr != "" {
go func() {
log.Debugf("Starting pprof page at http://%s/debug/pprof", *pprofAddr)
if err := http.ListenAndServe(*pprofAddr, nil); err != nil {
log.Error(err)
}
}()
}

showui = !*headless

if showui {
Expand Down

0 comments on commit 83fd0c5

Please sign in to comment.