diff --git a/pprof.go b/pprof.go new file mode 100644 index 0000000..4526fa1 --- /dev/null +++ b/pprof.go @@ -0,0 +1,5 @@ +// +build pprof + +package main + +import _ "net/http/pprof" diff --git a/proxy.go b/proxy.go index 93e01d9..422dc01 100644 --- a/proxy.go +++ b/proxy.go @@ -39,7 +39,7 @@ const ( ) var paths = struct { - Ping, Status, Err, Host, Quota, Route, Proxy, VNC, Video, Logs, Download, Clipboard, Devtools string + Ping, Status, Err, Host, Quota, Route, Proxy, VNC, Video, Logs, Download, Clipboard, Devtools, Pprof string }{ Ping: "/ping", Status: "/wd/hub/status", @@ -54,6 +54,7 @@ var paths = struct { Download: "/download/", Clipboard: "/clipboard/", Devtools: "/devtools/", + Pprof: "/debug/pprof/", } var keys = struct { @@ -767,5 +768,6 @@ func mux() http.Handler { mux.HandleFunc(paths.Download, WithSuitableAuthentication(authenticator, download)) mux.HandleFunc(paths.Clipboard, WithSuitableAuthentication(authenticator, clipboard)) mux.HandleFunc(paths.Devtools, devtools) + mux.Handle(paths.Pprof, http.DefaultServeMux) return mux }