diff --git a/http3/server.go b/http3/server.go
index <HASH>..<HASH> 100644
--- a/http3/server.go
+++ b/http3/server.go
@@ -709,19 +709,20 @@ func ListenAndServe(addr, certFile, keyFile string, handler http.Handler) error 
 	tlsConn := tls.NewListener(tcpConn, config)
 	defer tlsConn.Close()
 
+	if handler == nil {
+		handler = http.DefaultServeMux
+	}
 	// Start the servers
-	httpServer := &http.Server{}
 	quicServer := &Server{
 		TLSConfig: config,
+		Handler:   handler,
 	}
-
-	if handler == nil {
-		handler = http.DefaultServeMux
+	httpServer := &http.Server{
+		Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
+			quicServer.SetQuicHeaders(w.Header())
+			handler.ServeHTTP(w, r)
+		}),
 	}
-	httpServer.Handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
-		quicServer.SetQuicHeaders(w.Header())
-		handler.ServeHTTP(w, r)
-	})
 
 	hErr := make(chan error)
 	qErr := make(chan error)
http3: fix listening on both QUIC and TCP (#<I>)