Rename the proxy environment type and generated fake to clarify that the configuration surface belongs to the proxy server. Update proxy bootstrap, load balancers, protocol servers, debug, signal handling, tests, and codebase memory to use ProxyEnvironment.
22 lines
391 B
Go
22 lines
391 B
Go
// Copyright (c) 2026 Winlin
|
|
//
|
|
// SPDX-License-Identifier: MIT
|
|
package debug
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"srsx/internal/env"
|
|
"srsx/internal/logger"
|
|
)
|
|
|
|
func HandleGoPprof(ctx context.Context, environment env.ProxyEnvironment) {
|
|
if addr := environment.GoPprof(); addr != "" {
|
|
go func() {
|
|
logger.Df(ctx, "Start Go pprof at %v", addr)
|
|
http.ListenAndServe(addr, nil)
|
|
}()
|
|
}
|
|
}
|