Skip to content

Commit e17e603

Browse files
committed
cmd/server: handle empty NegotiatedProtocol with gateway
1 parent aa09d60 commit e17e603

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

cmd/server/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func main() {
163163
alpnMux := gateway.NewALPNMux(logger, gMux)
164164

165165
clientTLSListener := alpnMux.For("multiplexer")
166-
gatewayListener := alpnMux.For("http/1.1")
166+
gatewayListener := alpnMux.For("http/1.1", "")
167167

168168
domain := bundle.Web.Domain
169169
if *gatewayPort != 443 {

gateway/alpn.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ func (a *ALPN) Serve(ctx context.Context) {
8080
}
8181
}
8282

83-
func (a *ALPN) For(proto string) net.Listener {
83+
func (a *ALPN) For(protos ...string) net.Listener {
8484
ch := make(chan net.Conn, 32)
85-
a.protos.Store(proto, ch)
85+
for _, proto := range protos {
86+
a.protos.Store(proto, ch)
87+
}
8688
return &protoListener{
8789
l: a.listener,
8890
c: ch,

0 commit comments

Comments
 (0)