From 9fe501f406ed6ca1f8e98a6d6b4e94c2e03c389c Mon Sep 17 00:00:00 2001 From: eyedeekay Date: Fri, 18 Apr 2025 23:16:11 -0400 Subject: [PATCH] trigger rebuild --- net_mirror.go | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/net_mirror.go b/net_mirror.go index a6350e3..a8e0753 100644 --- a/net_mirror.go +++ b/net_mirror.go @@ -11,7 +11,24 @@ import ( "github.com/go-i2p/go-meta-listener/mirror" ) -var mirrorListener, mirrorErr = mirror.NewMirror("i2pgit.org") +func hostname() string { + hostname := os.Getenv("HOSTNAME") + if hostname == "" { + // get the local hostname + // this is a fallback for when the HOSTNAME environment variable is not set + hostname, err := os.Hostname() + if err != nil { + log.Printf("Warning: %s", err) + } + if hostname == "" { + // this is a fallback for when the hostname is not set + hostname = "localhost" + } + } + return hostname +} + +var mirrorListener, mirrorErr = mirror.NewMirror() // This implements the GetListener function for TLS, I2P, and Onion. Note the exemption for Unix sockets. func MultiGetListener(network, address string) (net.Listener, error) {