mirror of
https://github.com/ossrs/srs.git
synced 2025-02-15 04:42:04 +00:00
21 lines
322 B
Go
21 lines
322 B
Go
|
// Copyright (c) 2024 Winlin
|
||
|
//
|
||
|
// SPDX-License-Identifier: MIT
|
||
|
package main
|
||
|
|
||
|
import (
|
||
|
"context"
|
||
|
"net/http"
|
||
|
|
||
|
"srs-proxy/logger"
|
||
|
)
|
||
|
|
||
|
func handleGoPprof(ctx context.Context) {
|
||
|
if addr := envGoPprof(); addr != "" {
|
||
|
go func() {
|
||
|
logger.Df(ctx, "Start Go pprof at %v", addr)
|
||
|
http.ListenAndServe(addr, nil)
|
||
|
}()
|
||
|
}
|
||
|
}
|