Skip to content

Instantly share code, notes, and snippets.

@arastu
Last active February 5, 2018 20:24
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save arastu/a552850fa5eec7076ff64e7bfb10c541 to your computer and use it in GitHub Desktop.
Save arastu/a552850fa5eec7076ff64e7bfb10c541 to your computer and use it in GitHub Desktop.
# using:
# for set proxy:
# $ setproxy 127.0.0.1 8118
# for unset:
# $ unsetproxy
function setproxy() {
export {http,https,ftp,HTTP,HTTPS}_proxy=http://$1:$2
export no_proxy="localhost,127.0.0.1,master.cafecluster"
echo "Proxy variable(http,https,ftp) set to $1:$2"
}
function unsetproxy() {
unset {http,https,ftp,HTTP,HTTPS,no}_proxy
echo "Proxy variable(http,https,ftp) is unset!"
}
@numb95
Copy link

numb95 commented Feb 2, 2018

For those who use socks proxy (like me), they can edit line 2 to this
export {http,https,ftp,HTTP,HTTPS}_proxy=socks5://$1:$2
polipo and tsocks can be another solution :)

@arastu
Copy link
Author

arastu commented Feb 2, 2018

@numb95 👍 👍

@mehdialipour
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment