debug.go 322 B

1234567891011121314151617181920
  1. // Copyright (c) 2024 Winlin
  2. //
  3. // SPDX-License-Identifier: MIT
  4. package main
  5. import (
  6. "context"
  7. "net/http"
  8. "srs-proxy/logger"
  9. )
  10. func handleGoPprof(ctx context.Context) {
  11. if addr := envGoPprof(); addr != "" {
  12. go func() {
  13. logger.Df(ctx, "Start Go pprof at %v", addr)
  14. http.ListenAndServe(addr, nil)
  15. }()
  16. }
  17. }