Skip to main content

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.ManagerITMProxyClient(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.start()
    
    # set your application to use the proxy
    #  host: "localhost"
    #  port: f"{proxy_details['port']}"
    
    # do some work...
    
    # stop the proxy server
    mc.stop()
    

Or start a video client

  1. Create a custom configuration file named flask_config_video.py
MANAGERITM_CLIENT_COMMAND = ['/opt/bin/video.sh']
  1. Start manageritm server on port 8000.

    gunicorn --bind 0.0.0.0:8000 --workers 1 --log-level debug "manageritm.app:main()"
    
  2. In Python, create a client, start the ffmpeg service, stop the ffmpeg service

    import manageritm
    
    manageritm_addr = "localhost"
    manageritm_port = "8000"
    
    # create a manageritm client
    mc = manageritm.client.ManagerITMCommandClient(f'http://{manageritm_addr}:{manageritm_port}')
    client_details = mc.client(additional_env={
        'DISPLAY_CONTAINER_NAME': 'hanet_chrome_1',
        'DISPLAY_NUM': '99',
        'SE_VIDEO_FOLDER': '/videos',
        'FILE_NAME': 'blahh.mp4'
    })
    
    # start a proxy server
    mc.start()
    
    # recording should happening
    # ...
    
    # stop the proxy server
    mc.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.ManagerITMProxyClient(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.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.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

Metadata

Release files for manageritm 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for manageritm 0.4.0
File Size Uploaded
manageritm-0.4.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for manageritm 0.4.0
File Interpreter ABI Platform
manageritm-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 21.1 kB

Release files / manageritm-0.4.0.tar.gz

Download URL manageritm-0.4.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
d5c6e654df716905955dd723fb13e40c79173aa0edc0893474d71a9315a8727e
BLAKE2b-256 checksum
How to use checksums
a64a1a46091882797a0ee95a39a213599ada05acaf178f5d109e39d2db73905f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / manageritm-0.4.0-py3-none-any.whl

Download URL manageritm-0.4.0-py3-none-any.whl
Size 11.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc18941a18406f1c77f3b2d8771a115547b18662786e26b5dd6440e6de144dbc
BLAKE2b-256 checksum
How to use checksums
a8d326de33f9ef1437b6c87293eb3487b1bd52af0b4b7cff1515b23e247363b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page