diff options
| author | tjp <tjp@ctrl-c.club> | 2023-11-14 19:21:47 -0700 |
|---|---|---|
| committer | tjp <tjp@ctrl-c.club> | 2023-11-14 19:21:47 -0700 |
| commit | 04b5ba5d9d02a987e74d04bd61b6dc2c49c31a5d (patch) | |
| tree | 23d8c109a33ee886e5e050f518356852208babf0 /nex.go | |
| parent | 84374f083d4926ab12c0d939a695b9fa546696d4 (diff) | |
nex protocol fix to allow servers without hostnames
Diffstat (limited to 'nex.go')
| -rw-r--r-- | nex.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -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)), |
