proxy 是个好东西
2016-05-19 本文已影响482人
cptn3m0
为什么要用代理,其实用代理解决的问题是服务器无法直接访问外网的情况。
如果您的服务器可以畅通的访问互联网,请您pass以下内容。
linux bash trick
alias proxyon="export http_proxy='http://YOURPROXY:YOURPORT';export https_proxy='http://YOURPROXY:YOURPORT'"
alias proxyoff="export http_proxy='';export https_proxy=''"
alias proxydel="unset http_proxy; unset https_proxy"
使用 alias 指令, 在系统中注册几个proxy 相关的命令
- proxyon
- proxyoff
- proxydel
代理服务器软件
squid
各种工具的代理方案
通用解决解决方案
创建环境变量 http_proxy
和 https_proxy
export http_proxy=host:port
export https_proxy=host:port
github
~/.gitconfig
[http]
proxy = http://aaa.bbb.ccc.ddd:3128
[https]
proxy = http://aaa.bbb.ccc.ddd:3128
hg
~/.hgrc
[http_proxy]
host = aaa.bbb.ccc.ddd:3128
wget
~/.wgetrc
#You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
https_proxy = http://aaa.bbb.ccc.ddd:3128/
http_proxy = http://aaa.bbb.ccc.ddd::3128/
ftp_proxy = http://aaa.bbb.ccc.ddd::3128/
# If you do not want to use proxy at all, set this to off.
use_proxy = off
~