title | nav | order | ||||
---|---|---|---|---|---|---|
连接超时 |
|
28 |
方案一:通过 switchHosts 设置两套环境 公司 vpn
# BEGIN section for OpenVPN Client SSL sites
127.94.0.1 client.openvpn.net
# END section for OpenVPN Client SSL sites
develop
199.232.4.133 raw.githubusercontent.com
140.82.112.4 github.com
199.232.69.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
System Hosts
# Host Database
# when the system is booting. Do not change this entry.
## localhost is used to configure the loopback interface
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
# --- SWITCHHOSTS_CONTENT_START ---
199.232.4.133 raw.githubusercontent.com
140.82.113.4 github.com
199.232.69.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
方案二
git config --global --unset http.proxy
git config --global --unset https.proxy
sudo vim /etc/hosts
git config http.proxy http://192.168.201.9:8080
git config https.proxy http://192.168.201.9:8080
git config user.email "[email protected]"
git config user.name "EdisonVan"
git push -u origin --all
brew cask install switchhosts
ping raw.githubusercontent.com
-
git config --global --add remote.origin.proxy "127.0.0.1:7890"
-
https://blog.csdn.net/developer_zhao/article/details/107785387
-
sudo vim /etc/hosts
或Shift+Command+G
查找文件/etc/hosts
,确认前往 -
避免 DNS 污染,公司 vpn 和 github 环境用 switchosts 区分
-
终端在输以下指令刷新 DNS:
sudo killall -HUP mDNSResponder;say DNS cache has been flushed