summaryrefslogtreecommitdiff
path: root/nex.go
diff options
context:
space:
mode:
authortjp <tjp@ctrl-c.club>2023-11-14 19:21:47 -0700
committertjp <tjp@ctrl-c.club>2023-11-14 19:21:47 -0700
commit04b5ba5d9d02a987e74d04bd61b6dc2c49c31a5d (patch)
tree23d8c109a33ee886e5e050f518356852208babf0 /nex.go
parent84374f083d4926ab12c0d939a695b9fa546696d4 (diff)
nex protocol fix to allow servers without hostnames
Diffstat (limited to 'nex.go')
-rw-r--r--nex.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/nex.go b/nex.go
index bd9bdce..06cbb4d 100644
--- a/nex.go
+++ b/nex.go
@@ -20,10 +20,15 @@ func buildNexServer(server Server, config *Configuration) (sr.Server, error) {
info := level.Info(baselog)
errlog := level.Error(baselog)
+ hostname := ""
+ if len(server.Hostnames) > 0 {
+ hostname = server.Hostnames[0]
+ }
+
if server.TLS != nil {
return nex.NewTLSServer(
context.Background(),
- server.Hostnames[0],
+ hostname,
"tcp",
addr,
logging.LogRequests(info)(routes(server)),
@@ -33,7 +38,7 @@ func buildNexServer(server Server, config *Configuration) (sr.Server, error) {
} else {
return nex.NewServer(
context.Background(),
- server.Hostnames[0],
+ hostname,
"tcp",
addr,
logging.LogRequests(info)(routes(server)),