Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ func getBody(url string) (bytes.Buffer, error) {
}

func poll() (routines Routines, err error) {
url := fmt.Sprintf("http://%s/%s/goroutine?debug=2", *hostFlag, *endpointFlag)
url := "http"
if *secureFlag {
url = "https"
}
url = fmt.Sprintf("%s://%s/%s/goroutine?debug=2", url, *hostFlag, *endpointFlag)
buf, err := getBody(url)
if err != nil {
return
Expand Down
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ var (
// parse command line arguments
var (
helpFlag = flag.Bool("h", false, "display this help dialog")
secureFlag = flag.Bool("s", false, "use secure https protocol (default http)")
hostFlag = flag.String("host", "localhost:1234", "target host")
selfFlag = flag.Bool("self", false, "monitor grmon itself")
endpointFlag = flag.String("endpoint", "/debug/pprof", "target path")
Expand Down