Skip to content

Commit b31a9ac

Browse files
committed
Add port to host for lookup
Signed-off-by: Vishal Rana <vr@labstack.com>
1 parent 756d1dc commit b31a9ac

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

armor.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package armor
22

33
import (
44
"crypto/tls"
5+
"net"
56
"sync"
67
"time"
78

@@ -20,6 +21,7 @@ type (
2021
mutex sync.RWMutex
2122
Name string `json:"name"`
2223
Address string `json:"address"`
24+
Port string `json:"-"`
2325
TLS *TLS `json:"tls"`
2426
Admin *Admin `json:"admin"`
2527
Storm *Storm `json:"storm"`
@@ -133,7 +135,7 @@ func (a *Armor) FindHost(name string, add bool) (h *Host) {
133135
// Initialize host
134136
if !h.initialized {
135137
h.Paths = make(Paths)
136-
h.Group = a.Echo.Host(name)
138+
h.Group = a.Echo.Host(net.JoinHostPort(name, a.Port))
137139
h.Name = name
138140
h.initialized = true
139141
}

cmd/root.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ func initConfig() {
114114
if a.Address == "" {
115115
a.Address = ":80"
116116
}
117+
a.Port, _, _ = net.SplitHostPort(a.Address)
117118
if a.Storm == nil {
118119
a.Storm = &armor.Storm{
119120
URI: filepath.Join(a.RootDir, "storm.db"),

0 commit comments

Comments
 (0)