请教一个 MAC OS X 下大家都是怎么设置 Terminal 代理的

2016-01-07 16:42:19 +08:00
 kbm1422

例如我想用 Python 自动发邮件,,但是 STMP 是 Gmail 。

我已经有 Shdowsocks 代理并且设置了全局代理,,还是不行。

12144 次点击
所在节点    macOS
11 条回复
hrzhm
2016-01-07 17:18:50 +08:00
#!/bin/sh

cat <<EOF >> ~/.bash_profile
#
function start_tuproxy {
export http_proxy=''
export HTTPS_PROXY=''
}

function stop_tuproxy {
export http_proxy=
export HTTPS_PROXY=
}
EOF
halfcrazy
2016-01-07 17:21:38 +08:00
proxychains4
Starduster
2016-01-07 20:44:03 +08:00
proxychains4+sslocal
publicAdmin
2016-01-07 21:55:17 +08:00
proxychains4+sslocal +1
RqPS6rhmP3Nyn3Tm
2016-01-07 22:51:32 +08:00
@halfcrazy El Capitan 有不关 SIP 也可以使用的方法吗?
187j3x1
2016-01-07 23:30:18 +08:00
kifile
2016-01-07 23:42:50 +08:00
export all_proxy=socks5://127.0.0.1:1080
xpol
2016-01-08 09:24:30 +08:00
function proxy {
case $1 in
[1-9]*)
export http_proxy=socks5://127.0.0.1:$1
export https_proxy=$http_proxy
git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy
;;

off)
unset http_proxy
unset https_proxy
git config --global --unset http.proxy
git config --global --unset https.proxy
;;

la|lantern)
export http_proxy=http://127.0.0.1:8787
export https_proxy=$http_proxy
git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy
;;

ss|shadowsocks)
export http_proxy=socks5://127.0.0.1:1080
export https_proxy=$http_proxy
git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy
;;

pr|privoxy)
export http_proxy=http://127.0.0.1:8118
export https_proxy=$http_proxy
git config --global http.proxy $http_proxy
git config --global https.proxy $https_proxy
;;

"")
echo usage: proxy [port\|ss\|shadowsocks\|la\|lantern\|off]
;;
esac

echo http_proxy=$http_proxy
echo https_proxy=$https_proxy
}
napsterwu
2016-01-08 10:14:36 +08:00
其实只要
http_proxy=socks5://host:port 命令
就可以让这条命令走代理了 http 代理也行
RqPS6rhmP3Nyn3Tm
2016-01-08 12:43:26 +08:00
@187j3x1 谢谢,发现不是 SIP 的锅,其他程序代理都正常,就是 brew 特别慢, update 至少十分钟
RqPS6rhmP3Nyn3Tm
2016-01-08 12:45:25 +08:00
Yosemite 正常,升级 El Capitan 之后 brew 基本属于不能用的状态

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/249079

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX