go get 命令 i/o timeout 解决办法

来源:互联网 发布:微信数据怎么放到sd卡 编辑:程序博客网 时间:2024/06/05 16:50

1开启socks5代理

如shadowsocks。

2使用polipo代理

安装polipo

brew install polipo

修改polipo配置文件

vim /usr/local/opt/polipo/homebrew.mxcl.polipo.plist

在配置文件中加上socksParentProxy参数 socksParentProxy=localhost:1080

  <?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">  <plist version="1.0">    <dict>      <key>Label</key>      <string>homebrew.mxcl.polipo</string>      <key>RunAtLoad</key>      <true/>      <key>KeepAlive</key>      <true/>      <key>ProgramArguments</key>      <array>        <string>/usr/local/opt/polipo/bin/polipo</string>        <string>socksParentProxy=localhost:1080</string>      </array>    </dict>  </plist>

执行以下命令load

ln -sfv /usr/local/opt/polipo/*.plist ~/Library/LaunchAgentslaunchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist

完成设置

polipo进程默认监听8123端口,在命令行中:

export http_proxy=http://localhost:8123export https_proxy=http://localhost:8123
原创粉丝点击