在使用代理App时,虽然开了系统代理,但是比如iTerm2终端中还是不行。针对此问题,虽然Surge有增强模式可以解决这个,但是因为日常我需要VPN公司的原因,默认不开增强,因此需要寻求手段使得终端走代理服务。

如下即为解决方案

  1. 打开bash_profile,vi ~/.bash_profile
  2. 增加如下配置
  • export http_proxy=http://127.0.0.1:6152 export https_proxy=$http_proxy
  1. 变更生效 source ~/.bash_profile
  2. 测试
  3. curl -i https://google.com

这样iterm2发出的HTTP请求即可走代理服务了,一劳永逸,nice。

--

--

--

Develop with pleasure!

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Alan He

Alan He

Develop with pleasure!

More from Medium

Using SSH Tunnels for Remote Debugging

How to Show Hue Motion Data on a Website

Automatic login script for your Bastion Host

PYTHON ANONYMOUS FUNCTION OR LAMBDA