Below you will find pages that utilize the taxonomy term “Shadowsocks”
August 30, 2016
让终端走代理的几种方法
"\u003ch4 id=\"方法1:\"\u003e\u003cstrong\u003e方法1\u003c/strong\u003e\u003c/h4\u003e\n\u003cp\u003e在终端中直接运行命令\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eexport http_proxy=http://proxyAddress:port\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003e这个办法的好处是简单直接,并且影响面很小(只对当前终端有效)。\u003c/p\u003e\n\u003ch4 id=\"方法2:\"\u003e\u003cstrong\u003e方法2\u003c/strong\u003e\u003c/h4\u003e\n\u003cp\u003e把代理服务器地址写入shell配置文件\u003ccode\u003e.bashrc\u003c/code\u003e或者\u003ccode\u003e.zshrc\u003c/code\u003e\u003c/p\u003e\n\u003cp\u003e直接在\u003ccode\u003e.bashrc\u003c/code\u003e或者\u003ccode\u003e.zshrc\u003c/code\u003e添加下面内容\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eexport http_proxy=\u0026#34;http://localhost:port\u0026#34;\nexport https_proxy=\u0026#34;http://localhost:port\u0026#34;\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003e以使用shadowsocks代理为例,ss的代理端口为\u003ccode\u003e1080\u003c/code\u003e,那么应该设置为\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003eexport http_proxy=\u0026#34;http://127.0.0.1:1080\u0026#34;\nexport https_proxy=\u0026#34;http://127.0.0.1:1080\u0026#34;\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003e\u003ccode\u003elocalhost\u003c/code\u003e就是一个域名,域名默认指向 \u003ccode\u003e127.0.0.1\u003c/code\u003e,两者是一样的。\u003c/p\u003e\n\u003cp\u003e然后\u003ccode\u003eESC\u003c/code\u003e后\u003ccode\u003e:wq\u003c/code\u003e保存文件,接着在终端中执行\u003c/p\u003e\n\u003cpre tabindex=\"0\"\u003e\u003ccode\u003esource ~/.bashrc\n\u003c/code\u003e\u003c/pre\u003e\u003cp\u003e或者退出当前终端再起一个终端。 这个办法的好处 …\u003c/p\u003e"