首页 > Web开发 > 详细

`curl -L` 解决 GitHub 的 raw.githubusercontent.com 无法连接问题

时间:2020-10-23 15:06:29      阅读:98      评论:0      收藏:0      [点我收藏+]

解决 GitHub 的 raw.githubusercontent.com 无法连接问题

在使用 curl 下载文件时,如果出现以下情况

curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused

估计是 Github 的 raw 文件读取地址遭受了 DNS 污染,链接贼慢

查询 raw.githubusercontent.com 的 IP

修改 hosts 文件

文件路径 /etc/hosts

添加以下内容

# GitHub Start
52.74.223.119 github.com
192.30.253.112 gist.github.com
192.30.253.113 gist.github.com
192.30.253.119 gist.github.com
54.169.195.247 api.github.com
185.199.111.153 assets-cdn.github.com
151.101.76.133 raw.githubusercontent.com
151.101.108.133 user-images.githubusercontent.com
151.101.76.133 gist.githubusercontent.com
151.101.76.133 cloud.githubusercontent.com
151.101.76.133 camo.githubusercontent.com
151.101.185.194 github.global.ssl.fastly.net
# GitHub End

The_End

`curl -L` 解决 GitHub 的 raw.githubusercontent.com 无法连接问题

原文:https://www.cnblogs.com/codehhr/p/13863503.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!