@@ -455,7 +455,7 @@ def getLatencyAndJitter(ip, acceptable_latency):
455
455
# Set the headers for the download request
456
456
headers = {'Host' : 'speed.cloudflare.com' }
457
457
# Set the parameters for the download request
458
- params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " }
458
+ params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " , 'alpn' : 'h2,http/1.1' , 'utls' : 'random' }
459
459
460
460
latency = 0
461
461
jitter = 0
@@ -511,7 +511,7 @@ def getDownloadSpeed(ip, size, min_speed):
511
511
# Set the headers for the download request
512
512
headers = {'Host' : 'speed.cloudflare.com' }
513
513
# Set the parameters for the download request
514
- params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " }
514
+ params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " , 'alpn' : 'h2,http/1.1' , 'utls' : 'random' }
515
515
516
516
try :
517
517
# Start the timer for the download request
@@ -551,7 +551,7 @@ def getUploadSpeed(ip, size, min_speed):
551
551
# Set the URL, headers, and parameters for the request
552
552
url = 'https://speed.cloudflare.com/__up'
553
553
headers = {'Content-Type' : 'multipart/form-data' , 'Host' : 'speed.cloudflare.com' }
554
- params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " }
554
+ params = {'resolve' : f"speed.cloudflare.com:443:{ ip } " , 'alpn' : 'h2,http/1.1' , 'utls' : 'random' }
555
555
# Create a sample file with null bytes of the specified size
556
556
files = {'file' : ('sample.bin' , b"\x00 " * upload_size )}
557
557
0 commit comments