diff options
Diffstat (limited to 'echo/ports.go')
-rw-r--r-- | echo/ports.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/echo/ports.go b/echo/ports.go index bdd97fe..542446e 100644 --- a/echo/ports.go +++ b/echo/ports.go | |||
@@ -9,9 +9,18 @@ import ( | |||
9 | type AddressPortConfig struct { | 9 | type AddressPortConfig struct { |
10 | HttpPort int | 10 | HttpPort int |
11 | TlsPort int | 11 | TlsPort int |
12 | QuicPort int | ||
12 | Addresses []string | 13 | Addresses []string |
13 | } | 14 | } |
14 | 15 | ||
16 | func (c *AddressPortConfig) QuicBindings() []string { | ||
17 | o := make([]string, len(c.Addresses)) | ||
18 | for i, a := range c.Addresses { | ||
19 | o[i] = net.JoinHostPort(a, strconv.Itoa(c.QuicPort)) | ||
20 | } | ||
21 | return o | ||
22 | } | ||
23 | |||
15 | func (c *AddressPortConfig) TlsBindings() []string { | 24 | func (c *AddressPortConfig) TlsBindings() []string { |
16 | o := make([]string, len(c.Addresses)) | 25 | o := make([]string, len(c.Addresses)) |
17 | for i, a := range c.Addresses { | 26 | for i, a := range c.Addresses { |
@@ -60,6 +69,7 @@ func ParseAddressPortBindings(b []string) (*AddressPortConfig, error) { | |||
60 | } | 69 | } |
61 | 70 | ||
62 | o.TlsPort = o.HttpPort + 1 | 71 | o.TlsPort = o.HttpPort + 1 |
72 | o.QuicPort = o.TlsPort | ||
63 | 73 | ||
64 | return o, nil | 74 | return o, nil |
65 | } | 75 | } |