srs/proxy/internal/debug/pprof.go
winlin 4c39d2b8e8 Move proxy from ossrs/proxy repo to proxy directory
Move the SRS proxy server code from the standalone repository
https://github.com/ossrs/proxy into the proxy/ directory of the
main SRS repo. Also update build instructions in origin-cluster.md.
2026-02-15 09:48:27 -05:00

22 lines
388 B
Go

// Copyright (c) 2025 Winlin
//
// SPDX-License-Identifier: MIT
package debug
import (
"context"
"net/http"
"proxy/internal/env"
"proxy/internal/logger"
)
func HandleGoPprof(ctx context.Context, environment env.Environment) {
if addr := environment.GoPprof(); addr != "" {
go func() {
logger.Df(ctx, "Start Go pprof at %v", addr)
http.ListenAndServe(addr, nil)
}()
}
}