Skip to main content

Manage processes via an HTTP based API

Project description

manageritm

Manage a mitmproxy service on another system over a RESTful API

Getting Started

  1. Install manageritm.
    pip install manageritm gunicorn
    
  2. Start manageritm server on port 8000.
    gunicorn --bind 0.0.0.0:8000 --workers 1 --log-level debug "manageritm.app:main()"
    
  3. 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

  1. Check out this repository
  2. Create a virtual environment
    make pyenv
    
  3. Install Python dependencies
    make install
    
  4. Start the server
    make server
    
  5. 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()
    
  6. Navigate a web browser to http://localhost:<proxy webport> to watch the traffic
  7. Configure a web browser to use the proxy port.
  8. 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


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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

manageritm-0.1.0-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file manageritm-0.1.0.tar.gz.

File metadata

  • Download URL: manageritm-0.1.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.2 requests/2.28.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for manageritm-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b0da798c2803c78b3105ef28f7219c393b46a14e42cc2522b7618a1fe173fb59
MD5 200be60decb2099763a9d60cd6d8f4cc
BLAKE2b-256 21cd294701efd209930cf0ba10e1aa39d1e07325c055ba9184b348c3a775be71

See more details on using hashes here.

File details

Details for the file manageritm-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: manageritm-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.3 readme-renderer/37.2 requests/2.28.1 requests-toolbelt/0.10.0 urllib3/1.26.12 tqdm/4.64.1 importlib-metadata/5.0.0 keyring/23.9.3 rfc3986/2.0.0 colorama/0.4.5 CPython/3.9.14

File hashes

Hashes for manageritm-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7d56475e65d9210f91ddbef8cbaa213839b86deaea4c421cf177e45b631e9a53
MD5 60b6b3b3283efde8c37968ee52048fe4
BLAKE2b-256 5b66b196230eaeaa605df927eca9960e7187b7429410ceecc6a15834dbab7faf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page