Skip to content

Instantly share code, notes, and snippets.

@dangerwolf
Created December 9, 2016 08:28
Show Gist options
  • Select an option

  • Save dangerwolf/84966ffc8b7282710cc7010cee6525f4 to your computer and use it in GitHub Desktop.

Select an option

Save dangerwolf/84966ffc8b7282710cc7010cee6525f4 to your computer and use it in GitHub Desktop.

#如何为MacOS X终端设置代理

[TOC]

##HTTP代理 $ export http_proxy='http://YOUR_USERNAME:YOUR_PASSWORD@PROXY_IP:PROXY_PORT/'

##HTTPS代理

$ export https_proxy='http://YOUR_USERNAME:YOUR_PASSWORD@PROXY_IP:PROXY_PORT/'

##取消HTTP/HTTPS代理

$ unset http_proxy
$ unset https_proxy

##例子 让Terminal里的http访问走goagent的默认端口8087

$ export http_proxy='http://localhost:8087'
$ export https_proxy='http://localhost:8087'

$ export http_proxy='http://localhost:1087'
$ export https_proxy='http://localhost:1087'

$export http_proxy='http://202.106.16.36:3128/'
$export https_proxy='http://202.106.16.36:3128/'

$ tsocks /Applications/Textual.app/Contents/MacOS/Textual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment