Manage processes via an HTTP based API
Project description
manageritm
Manage a mitmproxy service on another system over a RESTful API
Getting Started
- Install manageritm.
pip install manageritm gunicorn
- Start manageritm server on port 8000.
gunicorn --bind 0.0.0.0:8000 --workers 1 --log-level debug "manageritm.app:main()"
- In Python, create a client, start the mitmproxy service, stop the mitmproxy service
import manageritm manageritm_addr = "localhost" manageritm_port = "8000" # create a manageritm client mc = manageritm.client.ManagerITMClient(f'http://{manageritm_addr}:{manageritm_port}') proxy_details = mc.client() print(f"proxy port: {proxy_details['port']}") print(f"proxy webport: {proxy_details['webport']}") # start a proxy server mc.proxy_start() # set your application to use the proxy # host: "localhost" # port: f"{proxy_details['port']}" # do some work... # stop the proxy server mc.proxy_stop()
Local Development
- Check out this repository
- Create a virtual environment
make pyenv
- Install Python dependencies
make install
- Start the server
make server
- Start a client, in a Python interpreter:
import manageritm manageritm_addr = "localhost" manageritm_port = "8000" # create a manageritm client mc = manageritm.client.ManagerITMClient(f'http://{manageritm_addr}:{manageritm_port}') proxy_details = mc.client() print(f"proxy port: {proxy_details['port']}") print(f"proxy webport: {proxy_details['webport']}") # start a proxy server mc.proxy_start()
- Navigate a web browser to
http://localhost:<proxy webport>
to watch the traffic - Configure a web browser to use the proxy port.
- Stop the client
# stop the proxy server mc.proxy_stop()
Helpful Commands
To build a package for the development version:
make all
To install a copy into your local python virtualenv
make install
To run the test cases:
make test
To run the development version of the service:
make run
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
manageritm-0.1.0.tar.gz
(9.3 kB
view hashes)
Built Distribution
manageritm-0.1.0-py3-none-any.whl
(10.3 kB
view hashes)
Close
Hashes for manageritm-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d56475e65d9210f91ddbef8cbaa213839b86deaea4c421cf177e45b631e9a53 |
|
MD5 | 60b6b3b3283efde8c37968ee52048fe4 |
|
BLAKE2b-256 | 5b66b196230eaeaa605df927eca9960e7187b7429410ceecc6a15834dbab7faf |