https://github.com/dhi13man/auto_proxy_wifi
Python Automation Script for Windows devices to automatically configure a proxy server on a wifi network, based on the network's SSID. Works using Windows environment variables, registry and CLI tools (Netsh).
https://github.com/dhi13man/auto_proxy_wifi
automation cli events netsh proxy python registry task-scheduler wifi windows
Last synced: 8 months ago
JSON representation
Python Automation Script for Windows devices to automatically configure a proxy server on a wifi network, based on the network's SSID. Works using Windows environment variables, registry and CLI tools (Netsh).
- Host: GitHub
- URL: https://github.com/dhi13man/auto_proxy_wifi
- Owner: Dhi13man
- License: gpl-3.0
- Created: 2021-11-22T05:34:27.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-02-25T13:43:00.000Z (over 4 years ago)
- Last Synced: 2025-04-14T08:56:42.478Z (about 1 year ago)
- Topics: automation, cli, events, netsh, proxy, python, registry, task-scheduler, wifi, windows
- Language: Python
- Homepage:
- Size: 238 KB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
- License: LICENSE.MD
Awesome Lists containing this project
README
# auto_proxy_wifi
Python Automation Script for Windows devices to automatically configure a proxy server on a wifi network based on the network's SSID. Works using Windows environment variables, registry and CLI tools (Netsh).
Utilizes Windows `schtasks` CLI tool for automatic event scheduling on Wi-Fi network change.
## Set-Up and Usage
- To set Proxy rules (which Proxy should be used for which Wi-Fi SSID) just modify the respective `main.py` or `main_loop.py` file and add the rule to `proxy_rules` as shown in the example rule. Wi-Fi names in Proxy Rules are case-insensitive.
Syntax for each ProxyRule: `ProxyRule(wifi_ssid: string, proxy_address: string, proxy_type: string (optional))`.
```python
proxy_rules: list = [
ProxyRule("wifi1", "http://proxy1:port1", "https"), # If Wi-Fi connected is wifi1, proxy should be http://proxy1:port1
ProxyRule("wifi2", "proxy2:port2", "socks5"),
ProxyRule("wifi3", ""), # If Wi-Fi connected is wifi3, there will be no proxy.
]
```
- There are two potential ways to use this script:
1. **Using Python Script `./src/main_loop.py` (More Memory-Intensive)**
- Just execute `./src/main_loop.py` with Python and watch the magic happen every time you switch Wi-Fi networks. :)
2. **Using Windows Scheduled Task Triggering with `./src/main.py` (Less Memory-Intensive)**
- Open any terminal and CD into src folder `cd /src`.
- Run `python3 ./setup.py` once and everything will be set up. :)
|  |
| --- |
|  |
| --- |
## Removal
- To Disable the script, just run `./src/disable.bat` and the scheduled event will be disabled.
- To Uninstall, remove this auto_proxy_wifi folder with all its contents.
|  |
| --- |