:nut_and_bolt: An oh-my-zsh plugin to configure proxy
Firstly, clone this repository in
oh-my-zsh's plugins directory.
git clone https://github.com/sukkaw/zsh-proxy.git ~/.oh-my-zsh/custom/plugins/zsh-proxy
Secondly, activate the plugin in
~/.zshrc. Enable it by adding
zsh-proxyto the plugins array.
plugins=( [plugins ...] zsh-proxy )
Antigen is a zsh plugin manager, and it support
oh-my-zshplugin as well. You only need to add
antigen bundle sukkaw/zsh-proxyto your
.zshrcwith your other bundle commands if you are using Antigen. Antigen will handle cloning the plugin for you automatically the next time you start zsh. You can also add the plugin to a running zsh with
antigen bundle sukkaw/zsh-proxyfor testing before adding it to your
Congratulations! Open a new terminal or run
source $HOME/.zshrc. If you see following lines, you have successfully installed
---------------------------------------- You should run following command first: $ init_proxy ----------------------------------------
The tip mentioned below will show up next time you open a new terminal if you haven't initialized the plugin with
After you run
init_proxy, it is time to configure the plugin.
config_proxywill lead you to zsh-proxy configuration. Fill in socks5 & http proxy address in format
Default configuration of socks5 proxy is
127.0.0.1:1080, and http proxy is
127.0.0.1:8080. You can leave any of them blank during configuration to use their default configuration.
zsh-proxydoesn't support proxy with authentication, but I am working on it.
After you configure the
zsh-proxy, you are good to go. Try following command will enable proxy for supported package manager & software:
And next time you open a new terminal, zsh-proxy will automatically enable proxy for you.
If you want to disable proxy, you can run following command:
If you forget whether you have enabled proxy or not, it is fine to run
proxycommand directly, as
proxywill reset all the proxy before enable them. But the smarter way is to use following command to check which IP you are using now:
Check procedure will use
curland the IP data come from
If you install
zsh-proxywith Antigen, you need to remove
antigen bundle sukkaw/zsh-proxyto disable the plugin. If you install
zsh-proxywith oh-myzsh, you need to remove
zsh-proxyitem from plugin array, then run
rm -rf ~/.oh-my-zsh/custom/plugins/zsh-proxyto remove the plugin.
And you can clean up files & folders created by
zsh-proxyusing following command:
$ rm -rf ~/.zsh-proxy
zsh-proxycurrently support those package manager & software:
env_keepor sorts of things)