{"id":23286,"library":"asysocks","title":"asysocks","description":"Asynchronous SOCKS4/5, HTTP proxy and SSH tunnel client library for Python, built on the asyncio framework. Current version 0.2.18, with irregular releases focusing on bug fixes and minor feature additions.","status":"active","version":"0.2.18","language":"python","source_language":"en","source_url":"https://github.com/skelsec/asysocks","tags":["SOCKS","proxy","asyncio","networking"],"install":[{"cmd":"pip install asysocks","lang":"bash","label":"Standard install"}],"dependencies":[{"reason":"Runtime core dependency (stdlib)","package":"asyncio","optional":false},{"reason":"Optional dependency for SOCKS proxy authentication cache","package":"aiosqlite","optional":true}],"imports":[{"note":"Common mistake: SocksClient is in asysocks.client module, not top-level.","wrong":"from asysocks import SocksClient","symbol":"SocksClient","correct":"from asysocks.client import SocksClient"},{"note":"HttpSocksClient is in asysocks.client, not a separate http module.","wrong":"from asysocks.http import HttpSocksClient","symbol":"HttpSocksClient","correct":"from asysocks.client import HttpSocksClient"},{"note":"Exceptions are in asysocks.common.exceptions.","wrong":"from asysocks.exceptions import SocksException","symbol":"SocksException","correct":"from asysocks.common.exceptions import SocksException"}],"quickstart":{"code":"import asyncio\nfrom asysocks.client import SocksClient\n\nasync def main():\n    client = SocksClient(\n        target=('example.com', 80),\n        proxy=('127.0.0.1', 1080),\n        proxy_type='socks5'\n    )\n    await client.connect()\n    await client.send(b'GET / HTTP/1.0\\r\\n\\r\\n')\n    response = await client.recv()\n    print(response)\n    await client.close()\n\nasyncio.run(main())","lang":"python","description":"Connect to example.com via a SOCKS5 proxy at localhost:1080 and send an HTTP request."},"warnings":[{"fix":"Use asyncio.run_coroutine_threadsafe or run all calls in the same event loop.","message":"The library uses asyncio, not threading. Do not call connect/send/recv from different threads without proper synchronization.","severity":"gotcha","affected_versions":"0.1.0+"},{"fix":"Update import to from asysocks.client import SocksClient.","message":"Old import path 'asysocks.SocksClient' is removed in 0.2.0+. Use 'from asysocks.client import SocksClient'.","severity":"deprecated","affected_versions":">=0.2.0"},{"fix":"Use async/await patterns. Refer to the quickstart example.","message":"In version 0.2.0, the API was rewritten. The previous synchronous client no longer exists. All methods return coroutines.","severity":"breaking","affected_versions":"0.2.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'pip install asysocks' and ensure you are using the correct Python interpreter.","cause":"Library not installed or installed in wrong Python environment.","error":"ModuleNotFoundError: No module named 'asysocks'"},{"fix":"Use 'from asysocks.client import SocksClient'.","cause":"Trying to import SocksClient directly from the package instead of the submodule.","error":"AttributeError: module 'asysocks' has no attribute 'SocksClient'"},{"fix":"Ensure all asyncio operations run in the same event loop. Use asyncio.run() for top-level.","cause":"Creating the client in one event loop and using it in another, or mixing asyncio and threading.","error":"RuntimeError: Task <Task pending> got Future <Future pending> attached to a different loop"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}