This commit is contained in:
本间白猫 2024-09-14 22:31:46 +08:00
parent 4b6c14a102
commit 519cee15d1

View File

@ -452,12 +452,12 @@ async def check_proxy(proxy):
return False return False
async def check_http_proxy(proxy): async def check_http_proxy(proxy):
async with httpx.AsyncClient(proxies={'http': proxy}, timeout=10) as client: async with httpx.AsyncClient(proxies={'http://': proxy}, timeout=10) as client:
response = await client.get('http://www.baidu.com') response = await client.get('http://www.baidu.com')
return response.status_code == 200 return response.status_code == 200
async def check_https_proxy(proxy): async def check_https_proxy(proxy):
async with httpx.AsyncClient(proxies={'https': proxy}, timeout=10) as client: async with httpx.AsyncClient(proxies={'https://': proxy}, timeout=10) as client:
response = await client.get('https://www.baidu.com') response = await client.get('https://www.baidu.com')
return response.status_code == 200 return response.status_code == 200