此处用来记录 Proxy 的过程中可能会遇到的问题。

Failed to connect to github.com port 443: Connection timed out, but valid connection in browser - Windows

git config unset proxy

This method doesn’t work

1
2
git config --global --unset http.proxy
git config --global --unset https.proxy

git config proxy

This method doesn’t work

1
2
git config --global https.proxy http://127.0.0.1:1080
git config --global http.proxy http://127.0.0.1:1080

edit host file

The addresses are what I copied from the websites. You should copy your own.

  1. open https://github.com.ipaddress.com/

    1. copy IP Address: 140.82.114.4
  2. open https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo

    1. copy IP Address: 199.232.5.194
  3. open https://github.com.ipaddress.com/assets-cdn.github.com

    1. copy the four IP Addresses in assets-cdn.github.com resolves to the following 4 IPv4 addresses:
  4. Edit host file:

    1. open host file in C:\Windows\System32\drivers\etc

    2. edit the file with the IP Addresses we copied:

      1
      2
      3
      4
      5
      6
      140.82.114.4 github.com 
      199.232.5.194 github.global.ssl.fastly.net
      185.199.108.153 assets-cdn.github.com
      185.199.109.153 assets-cdn.github.com
      185.199.110.153 assets-cdn.github.com
      185.199.111.153 assets-cdn.github.com
  1. Flush DNS in Windows

    1. Open a terminal (PowerShell for example)

      1
      2
      3
      4
      $ ipconfig /flushdns

      Windows IP Configuration
      Successfully flushed the DNS Resolver Cache.
  2. Unset git proxies (Optional)

    If it still doesn’t work, you could try:

    1
    2
    git config --global --unset http.proxy
    git config --global --unset https.proxy

Go Module Proxy

Get “https://cloud.google.com/go?go-get=1": dial tcp 172.217.24.14:443 failed time out.

When building and indexing projects on WIN10 + Goland + WSL2, I met the the error above. There’re several places where we can set the proxy to make it work.

Win10

Set the GOPROXY in Terminal

1
go env -w GOPROXY=https://goproxy.cn,direct

WSL

Set the GOPROXY in .bashrc

1
export GOPROXY=https://goproxy.cn,direct

GoLand

File - Settings - Go - Go Modules

  • Check Enable Go module integration

  • Environment : GOPROXY=https://goproxy.cn,direct