TUN-5138: Switch to QUIC on auto protocol based on threshold

This commit is contained in:
Sudarsan Reddy
2021-10-11 11:31:05 +01:00
committed by Nuno Diegues
parent 5a3c0fdffa
commit ceb509ee98
7 changed files with 250 additions and 218 deletions

View File

@@ -351,7 +351,7 @@ func serveTunnel(
)
switch protocol {
case connection.QUIC:
case connection.QUIC, connection.QUICWarp:
connOptions := config.ConnectionOptions(addr.UDP.String(), uint8(backoff.Retries()))
return ServeQUIC(ctx,
addr.UDP,
@@ -361,7 +361,7 @@ func serveTunnel(
reconnectCh,
gracefulShutdownC)
case connection.HTTP2:
case connection.HTTP2, connection.HTTP2Warp:
edgeConn, err := edgediscovery.DialEdge(ctx, dialTimeout, config.EdgeTLSConfigs[protocol], addr.TCP)
if err != nil {
connLog.Err(err).Msg("Unable to establish connection with Cloudflare edge")