A small example package
Project description
hackhttp2
intro
This repo is inspired by hackhttp, but it's out of date already. so, I create this repo to make simulation and Network request easier.
Aims to
- make simulation easier
- use the raw request that generated by burp directly
- make the use of multi-thread easier
- make the use of coroutines easier
- config every thing easier
startup
### send a request from raw
from hackhttp2 import hackhttp
hh = hackhttp()
# set global configs, if you don't have special needs, default settings is ok.
# hh.globals.xxx = xxx
resp = hh.load_raw("path_of_raw.txt").send()
### useage of coroutine
hh.globals.kwargs.update({"allow_redirects":False})
req = hh.load_raw("baidu.txt")
with hh.create_pool_coroutine() as p:
p.add_reqs([req]*num)
p.start_all()
### useage of multi-thread
with hh.create_pool_thread() as p:
p.add_reqs([req]*num)
p.start_all()
p.join_all()
concepts
hackhttp2 is based on requests for ordinary requests and httpx for async requests. when you use hh.load_raw(), you'll get a Request obj, which can be modified by yourself. Once the modification is completed, you can use req.send() to send the request.
hh.globalsis a global configuration for hackhttp, you can set global header/cookie/kwargs(kwargs of requests.request)by your self.
You can setup some hackhttp() to manage your connections, because one hackhttp() shares one Session which is the value of the attribute .client, and it'll be changed when using coroutine.
ending
It's still in developing, but it can satisfy your basic needs. The useage of thread_pool & coroutine_pool needs to be careful when number of conn is higher than 10, because the limit of conn_pool in the requests. I'm working on how to make it gracefully to control the api.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hackhttp2-0.0.45.tar.gz.
File metadata
- Download URL: hackhttp2-0.0.45.tar.gz
- Upload date:
- Size: 4.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
32aeee9f0266ac02a9fa94e1e240e2eeb87c1cebc619df127876e98b33f98103
|
|
| MD5 |
ad60d8942897de948026ef89b77679fc
|
|
| BLAKE2b-256 |
b207820dc3457f3157d558a4b7d09386f72555c09bc5bf4018f1c30f1a0c7bdd
|
File details
Details for the file hackhttp2-0.0.45-py3-none-any.whl.
File metadata
- Download URL: hackhttp2-0.0.45-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.5.0 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.9.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
235dc0a667ba5fc4edd24685418c105649809fe630ce952973c72f849bc628a4
|
|
| MD5 |
7703fee8a6547e0d3502aee1d97c53c5
|
|
| BLAKE2b-256 |
61de1cb1f9c2e89056956427232025bf21e57c0a0dc4c72d8fd2d9173e748474
|