此处用来记录 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 | git config --global --unset http.proxy |
git config proxy
This method doesn’t work
1 | git config --global https.proxy http://127.0.0.1:1080 |
edit host file
The addresses are what I copied from the websites. You should copy your own.
open https://github.com.ipaddress.com/
- copy
IP Address
: 140.82.114.4
- copy
open https://fastly.net.ipaddress.com/github.global.ssl.fastly.net#ipinfo
- copy
IP Address
: 199.232.5.194
- copy
open https://github.com.ipaddress.com/assets-cdn.github.com
- copy the four IP Addresses in
assets-cdn.github.com resolves to the following 4 IPv4 addresses:
- copy the four IP Addresses in
Edit host file:
open
host
file in C:\Windows\System32\drivers\etcedit the file with the IP Addresses we copied:
1
2
3
4
5
6140.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
Flush DNS in Windows
Open a terminal (PowerShell for example)
1
2
3
4ipconfig /flushdns
Windows IP Configuration
Successfully flushed the DNS Resolver Cache.
Unset git proxies (Optional)
If it still doesn’t work, you could try:
1
2git 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