diff options
Diffstat (limited to 'gemini/serve.go')
-rw-r--r-- | gemini/serve.go | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gemini/serve.go b/gemini/serve.go index f9a8a1c..bc13531 100644 --- a/gemini/serve.go +++ b/gemini/serve.go @@ -32,10 +32,12 @@ func NewServer( return nil, err } + addr := listener.Addr() + s := &Server{ ctx: ctx, - network: network, - address: address, + network: addr.Network(), + address: addr.String(), wg: &sync.WaitGroup{}, listener: tls.NewListener(listener, tlsConfig), handler: handler, @@ -59,7 +61,7 @@ func (s *Server) Serve() error { s.ctx, s.cancel = context.WithCancel(s.ctx) s.wg.Add(1) - go s.propagateCancel() + s.propagateCancel() for { conn, err := s.listener.Accept() |