-
-
Notifications
You must be signed in to change notification settings - Fork 450
Description
Description
I’ve encountered a regression in curl_cffi 0.14.0 when using an asynchronous session with a SOCKS5 proxy.
The same code works correctly in curl_cffi 0.13.0, but in 0.14.0 the request always times out.
The issue happens when performing an async HTTPS request through a SOCKS5 proxy using AsyncSession.
Steps to Reproduce
import asyncio
import curl_cffi
TOR_SOCKS5 = 'socks5://192.168.1.30:9010'
async def get(session, url: str):
response = await session.get(url)
if response.ok:
return response.text
return 'ERROR'
async def main():
session = curl_cffi.AsyncSession(
proxies={
'http': TOR_SOCKS5,
'https': TOR_SOCKS5
}
)
html = await get(session, 'https://httpbin.org/get')
print(html)
if __name__ == '__main__':
asyncio.run(main())
Actual Behavior
The request fails with a timeout error:
Traceback (most recent call last):
File ".\env3.13\Lib\site-packages\curl_cffi\requests\session.py", line 1143, in request
await task
curl_cffi.curl.CurlError: Failed to perform, curl: (28) Connection timed out after 30009 milliseconds.
See https://curl.se/libcurl/c/libcurl-errors.html for more details.
Expected Behavior
The request should complete successfully and return the response body, as it does in curl_cffi 0.13.0.
Comparison
✅ curl_cffi 0.13.0 → Works correctly
❌ curl_cffi 0.14.0 → Always times out
Environment
Python: 3.13
OS: Windows
Proxy type: SOCKS5
Async API: AsyncSession
Additional Notes
The SOCKS5 proxy is on my local network, accessible, and working correctly.
The same proxy and code work with curl_cffi 0.13.0.
This appears to be a regression introduced in 0.14.0.