From b9f02ddbea3b5dfe45a2fef635eb61a8e6622c63 Mon Sep 17 00:00:00 2001 From: Fijxu Date: Mon, 17 Feb 2025 02:01:25 -0300 Subject: [PATCH] test: h2client custom dialer for testing --- main.go | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/main.go b/main.go index b5985d1..af4468c 100644 --- a/main.go +++ b/main.go @@ -40,8 +40,7 @@ var h3client = &http.Client{ } var dialer = &net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, + Timeout: 30 * time.Second, } var proxy string @@ -49,19 +48,19 @@ var proxy string // http/2 client var h2client = &http.Client{ Transport: &http.Transport{ - Dial: func(network, addr string) (net.Conn, error) { - var net string - if ipv6_only { - net = "tcp6" - } else { - net = "tcp4" - } - return dialer.Dial(net, addr) - }, + // Dial: func(network, addr string) (net.Conn, error) { + // var net string + // if ipv6_only { + // net = "tcp6" + // } else { + // net = "tcp4" + // } + // return dialer.Dial(net, addr) + // }, TLSHandshakeTimeout: 10 * time.Second, ResponseHeaderTimeout: 20 * time.Second, ExpectContinueTimeout: 1 * time.Second, - IdleConnTimeout: 30 * time.Second, + IdleConnTimeout: 20 * time.Second, ReadBufferSize: 16 * 1024, ForceAttemptHTTP2: true, MaxConnsPerHost: 0,