No project description provided
Project description
manageritm-client
Client to manage services on another system over a RESTful API
Getting Started
- Install manageritm server.
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()"
- Install manageritm-client.
pip install manageritm-client
- In Python, create a client, start the mitmproxy service, stop the mitmproxy service
import manageritm_client 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()
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_client 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()
- 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.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
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
Built Distribution
Close
Hashes for manageritm_client-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecb38bde8afd5c97ad61954b0861a93340d7b9a63ed7003f6bce392fe6149ce1 |
|
MD5 | a22758b72cc3edb5a2b14f8eddaa9c23 |
|
BLAKE2b-256 | 2b542f1f979db255f81612f7a5a9577e8d6a0ae56fcbd0c746a372d40a4832fc |