all repos — website @ e7add352f8996658f64b04d040b31cb156ce09e8

My website

fix listening on TCP only without listenfd
Alan Pearce alan@alanpearce.eu
Wed, 29 Jan 2025 23:06:11 +0100
commit

e7add352f8996658f64b04d040b31cb156ce09e8

parent

3162ceaa0f7997742f8c2fce1c9660e8e86ad5bb

1 files changed, 7 insertions(+), 1 deletions(-)

jump to
M internal/server/tcp.gointernal/server/tcp.go
@@ -1,11 +1,17 @@ package server
 
 import (
+	"net"
+	"strconv"
+
 	"go.alanpearce.eu/x/listenfd"
 )
 
 func (s *Server) serveTCP() error {
-	l, err := listenfd.GetListener(0, s.Addr, s.log.Named("tcp.listenfd"))
+	l, err := listenfd.GetListener(0,
+		net.JoinHostPort(s.runtimeConfig.ListenAddress, strconv.Itoa(s.runtimeConfig.Port)),
+		s.log.Named("tcp.listenfd"),
+	)
 	if err != nil {
 		return err
 	}