From 375b60961014febb7af39173e9986ab80688d810 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Fri, 7 Jun 2019 16:27:37 +0800 Subject: [PATCH] fix ALPN in echo example --- example/echo/echo.go | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/example/echo/echo.go b/example/echo/echo.go index 0f39c1270..44a93103f 100644 --- a/example/echo/echo.go +++ b/example/echo/echo.go @@ -49,7 +49,11 @@ func echoServer() error { } func clientMain() error { - session, err := quic.DialAddr(addr, &tls.Config{InsecureSkipVerify: true}, nil) + tlsConf := &tls.Config{ + InsecureSkipVerify: true, + NextProtos: []string{"quic-echo-example"}, + } + session, err := quic.DialAddr(addr, tlsConf, nil) if err != nil { return err } @@ -101,5 +105,8 @@ func generateTLSConfig() *tls.Config { if err != nil { panic(err) } - return &tls.Config{Certificates: []tls.Certificate{tlsCert}} + return &tls.Config{ + Certificates: []tls.Certificate{tlsCert}, + NextProtos: []string{"quic-echo-example"}, + } }