From 401d87a3eb1159730f8963577037456b6ffe2d48 Mon Sep 17 00:00:00 2001
From: Andrey Meshkov <am@adguard.com>
Date: Mon, 15 Aug 2022 10:27:57 +0300
Subject: [PATCH] Fix #260: enable KeepAlive for DoQ

---
 upstream/upstream_quic.go | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/upstream/upstream_quic.go b/upstream/upstream_quic.go
index 36508c00b..b27062f6a 100644
--- a/upstream/upstream_quic.go
+++ b/upstream/upstream_quic.go
@@ -220,7 +220,9 @@ func (p *dnsOverQUIC) openConnection() (conn quic.Connection, err error) {
 	}
 
 	addr := udpConn.RemoteAddr().String()
-	quicConfig := &quic.Config{}
+	quicConfig := &quic.Config{
+		KeepAlive: true,
+	}
 	conn, err = quic.DialAddrContext(context.Background(), addr, tlsConfig, quicConfig)
 	if err != nil {
 		return nil, fmt.Errorf("opening quic connection to %s: %w", p.Address(), err)