Documentation
¶
Overview ¶
Package pprofhttp builds the opt-in pprof server used by amux binaries.
Index ¶
Constants ¶
const AllowRemoteEnv = "AMUX_PPROF_ALLOW_REMOTE"
AllowRemoteEnv is the environment variable that opts in to serving pprof on a non-loopback address. Set it to "1" (or "true") alongside a non-loopback AMUX_PPROF value to allow the remote bind.
Variables ¶
This section is empty.
Functions ¶
func AddrFromEnvValue ¶
AddrFromEnvValue converts an AMUX_PPROF value into a listen address.
The convenience forms are loopback-locked: "1"/"true" resolve to 127.0.0.1:6060 and a bare port resolves to 127.0.0.1:<port>. An explicit host:port whose host is non-loopback — including an empty host such as ":6060", which binds all interfaces — is only honored when the AMUX_PPROF_ALLOW_REMOTE=1 opt-in is also set, because the pprof endpoints serve process argv and heap contents (which can include in-memory secrets) to anyone who can reach the port, with no authentication. Without the opt-in, a non-loopback bind with a usable port is downgraded to 127.0.0.1:<port>; one without a usable port is refused (ok=false).
The returned warning is non-empty whenever a non-loopback bind was requested (allowed, downgraded, or refused); callers should log it.
Types ¶
This section is empty.