LocalProxy is a Python command-line tool for managing and applying proxy configurations. It allows you to set, list, and clear proxy settings, which are stored in a configuration file and can be easily applied to your environment.
- Set HTTP and HTTPS proxy configurations
- List existing proxy configurations
- Clear all proxy configurations
- Apply proxy settings to the environment in other projects
pip3 install pylocalproxy- Python 3.8 or higher
- Poetry for package management
- Clone the repository:
git clone https://github.com/EvensXia/localproxy.git
cd localproxy- Install the project using Poetry:
poetry install- Build the project:
poetry build- Install the built wheel file:
pip install dist/localproxy-0.1.0-py3-none-any.whl- List existing proxy configurations:
localproxy list- Set a proxy configuration:
localproxy set <protocol> <address>Example:
localproxy set http http://localhost:8080- Clear all proxy configurations:
localproxy clear- Run scripts/code/modules:
localproxy /path/to/your/script.py
localproxy -c "import requests;print(requests.get('https://www.google.com'))"
localproxy -m your.module- Print CLI help:
localproxy -hIn your other Python projects, you can import and apply the proxy settings as follows:
from localproxy import proxy
proxy.init()This will apply the proxy settings stored in ~/.localproxy/proxy.toml to your environment variables.
Proxy configurations are stored in a TOML file located at ~/.localproxy/proxy.toml. This file is managed automatically by the CLI commands.