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.globals
is 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
Hashes for hackhttp2-0.0.45-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 235dc0a667ba5fc4edd24685418c105649809fe630ce952973c72f849bc628a4 |
|
MD5 | 7703fee8a6547e0d3502aee1d97c53c5 |
|
BLAKE2b-256 | 61de1cb1f9c2e89056956427232025bf21e57c0a0dc4c72d8fd2d9173e748474 |