summaryrefslogtreecommitdiff
path: root/gopher.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-10-10 16:53:51 -0600
committertjpcc <tjp@ctrl-c.club>2023-10-10 16:53:51 -0600
commit365b6bd5319cde40b5cf34b73d01e0fe5755d92e (patch)
treeccf0b05ef06baa70902db3c680b2a269d4b202ae /gopher.go
parent38a195c6e62dfebed3c0c642ec9e3fcc89516097 (diff)
support server TLS in gopher and finger
fixes #8
Diffstat (limited to 'gopher.go')
-rw-r--r--gopher.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/gopher.go b/gopher.go
index 1c13886..d5cf3c0 100644
--- a/gopher.go
+++ b/gopher.go
@@ -20,6 +20,18 @@ func buildGopherServer(server Server, config *Configuration) (sr.Server, error)
_, info, _, errlog := Loggers(config)
_ = info.Log("msg", "starting gopher server", "addr", addr)
+ if server.TLS != nil {
+ return gopher.NewTLSServer(
+ context.Background(),
+ server.Hostnames[0],
+ "tcp",
+ addr,
+ logging.LogRequests(info)(routes(server)),
+ errlog,
+ server.TLS,
+ )
+ }
+
return gopher.NewServer(
context.Background(),
server.Hostnames[0],