From 39a612707074633185d83eeb140386420e2663d3 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Thu, 27 Jul 2023 16:12:14 -0700 Subject: [PATCH] support custom self-port --- main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.go b/main.go index ff52969..9351787 100644 --- a/main.go +++ b/main.go @@ -44,6 +44,9 @@ var port = func() string { }() var selfDetectPort = func() string { + if sp := os.Getenv("HPERF_SELF_PORT"); sp != "" { + return sp + } sp, err := strconv.Atoi(port) if err != nil { log.Fatal(err)