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

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/LaunchAgents
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.polipo.plist

完成设置

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

export http_proxy=http://localhost:8123
export https_proxy=http://localhost:8123

猜你喜欢

转载自blog.csdn.net/wlchn/article/details/73921011