{"id":28637285,"url":"https://github.com/ax/asyhttp","last_synced_at":"2025-06-12T18:10:10.118Z","repository":{"id":57412101,"uuid":"237411320","full_name":"ax/asyhttp","owner":"ax","description":"A simple module to perform asynchronous HTTP requests using asyncio and aiohttp. ","archived":false,"fork":false,"pushed_at":"2020-02-16T22:08:08.000Z","size":21,"stargazers_count":12,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-29T18:26:12.443Z","etag":null,"topics":["aiohttp","async","asynchronous","asyncio","bruteforce","http","http-requests","pyhton","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ax.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-31T10:52:15.000Z","updated_at":"2024-08-03T22:31:09.000Z","dependencies_parsed_at":"2022-09-08T00:52:22.617Z","dependency_job_id":null,"html_url":"https://github.com/ax/asyhttp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ax/asyhttp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax%2Fasyhttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax%2Fasyhttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax%2Fasyhttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax%2Fasyhttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ax","download_url":"https://codeload.github.com/ax/asyhttp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ax%2Fasyhttp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259518828,"owners_count":22870304,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aiohttp","async","asynchronous","asyncio","bruteforce","http","http-requests","pyhton","python"],"created_at":"2025-06-12T18:10:01.536Z","updated_at":"2025-06-12T18:10:10.110Z","avatar_url":"https://github.com/ax.png","language":"Python","readme":"=======\nasyhttp\n=======\n\n.. image:: https://badge.fury.io/py/asyhttp.svg\n   :target: https://pypi.org/project/asyhttp\n   :alt: Latest PyPI package version\n\nThis is asyhttp, a simple module to perform asynchronous HTTP requests using asyncio and aiohttp.\n\nIt provides a trivial way to perform a set of async HTTP requests.\n\nFeatures\n--------\n- Proxy support\n- Custom headers \n- Allow redirects \n- Use TLS\n\nHow to use loop()\n-----------------\nasyhttp loop() accepts some ``args``\n\n- ``urls`` a set of dictionaries, each dict represent an HTTP request.\n- ``proxy`` (str) proxt URL, str (optional).\n- ``process_out`` a user defined function that can be used to process the response of each HTTP request.\n  It will be called by the async function that perform each HTTP request, as soon as the response arrive (optional). \n- ``redirects`` (bool) – If set to True, follow redirects. False by default (optional).\n- ``verify_tls`` (bool) True for check TLS cert validation, False by default (optional). \n\nGetting started\n---------------\n\n.. code:: python\n\n\tfrom asyhttp import loop\n\n\trequests = [\t{'url':'http://exam.ple/page.html', 'method':'GET'},\n\t\t\t{'url':'http://exam.ple/page.html', 'method':'POST', 'body' : 'blabla'}\n\t] \n\tloop(urls=requests)\n\nUse cases\n---------\nasyhttp loop can be useful to write quick bruteforces against vulnerable systems\nor as a core for tools like `dirfy \u003chttps://github.com/pyno/dirfy/\u003e`_.\n\nAn early version of this code comes from https://pawelmhm.github.io/asyncio/python/aiohttp/2016/04/22/asyncio-aiohttp.html\n\nDocs\n----\n\nProcess HTTP responses\n^^^^^^^^^^^^^^^^^^^^^^\nBy default, asyhttp loop print on stdout HTTP status code and reason for each response received.\nYou can override its default behavior writing custom code to process the response your HTTP requests.\nYour code has to be written in a function and passed to loop as a kwarg called process_out.\nThat function will be called by the async function that perform each of your HTTP requests,\nas soon as the response arrive. \n\nIn your custom code you can process:\n- url: url of the HTTP request\n- return_code \n- reason\n- resp_body\n- user_data\n\nExample\n\"\"\"\"\"\"\"\n\n.. code:: \n\n\tpip install asyhttp\n\n.. code:: python\n\n\tfrom asyhttp import loop\n\trequests = [{'url':'http://exam.ple/page.html', 'method':'GET'}]\n\tloop(urls=requests)\n\nExample\n\"\"\"\"\"\"\"\n.. code:: python\n\n\tfrom asyhttp import loop\n\n\tdef process_output(url,return_code,reason,resp_body,user_data):\n\t\tif return_code == 200:\n\t\t\tsys.stdout.write(\"url\")\n\n\trequests = [{'url':'http://exam.ple/page.html', 'method':'GET'}]\n\tloop(urls=requests,process_out=process_output)\n\nasyhttp loop's ``args``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^\n- ``urls``\n- ``process_out``\n- ``proxy``\n- ``verify_tls``\n- ``redirects``\n\nSupported HTTP methods\n^^^^^^^^^^^^^^^^^^^^^^\n- GET\n- POST\n- HEAD\n\nHTTP requests format\n^^^^^^^^^^^^^^^^^^^^\n\n.. code:: python\n\n\t{'method':'GET', 'url':'http://exam.ple/page.html'}\n\t{'method':'POST', 'url':'http://exam.ple/page.html','body':'blablabl=balbal'}\n\t{'url':'http://exam.ple/page.html', 'method':'GET', 'headers' : 'X-Custom-Header:YEAH'}\n\nProxy support\n^^^^^^^^^^^^^\n\n.. code:: python\n\n\tloop(urls=url_dict_list,proxy=\"http://127.0.0.1:8080\")\n\nCustom headers\n^^^^^^^^^^^^^^\nTo add HTTP headers to a request, pass them as a dict.\n\n.. code:: python\n\n\t{'url':'http://exam.ple/page.html', 'method':'GET', 'headers' : {'User-agent':'YEAH'}}\n\nAllow redirects\n^^^^^^^^^^^^^^^\nFalse by default\n\n.. code:: python\n\n\tloop(urls=requests,process_out=process_response,redirects=True)\n\nVerify TLS\n^^^^^^^^^^\nFalse by default\n\n.. code:: python\n\n\tloop(urls=requests,process_out=process_response,verify_tls=True)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax%2Fasyhttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fax%2Fasyhttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fax%2Fasyhttp/lists"}