Created
March 19, 2019 03:55
-
-
Save ayakix/f1c98e4bc99a96f6b710c18edc3b5f11 to your computer and use it in GitHub Desktop.
mitmproxy launcher
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
proxy_on() { | |
networksetup -setwebproxy Wi-Fi 0.0.0.0 8080 | |
# networksetup -setwebproxy Wi-Fi localhost 8080 | |
networksetup -setwebproxystate Wi-Fi on | |
networksetup -setsecurewebproxy Wi-Fi 0.0.0.0 8080 | |
# networksetup -setsecurewebproxy Wi-Fi localhost 8080 | |
networksetup -setsecurewebproxystate Wi-Fi on | |
} | |
proxy_off() { | |
retval=$? | |
networksetup -setwebproxystate Wi-Fi off | |
networksetup -setsecurewebproxystate Wi-Fi off | |
exit $retval | |
} | |
trap proxy_off INT QUIT TERM EXIT | |
proxy_on | |
mitmproxy -p 8080 "$@" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment