当前位置: 首页 > 科技观察

无法访问GitHub?用这个方法轻松解决

时间:2023-03-17 01:25:41 科技观察

Github是世界上最大的开源代码平台。很多程序员会用它来寻找一些优质的开源项目,或者把自己的开源项目托管在上面来提升自己。不知道你最近有没有遇到这种情况。github老是突然进不去,解析出来的IP都时不时出现tcpconnecttimeout。很容易连接不上。据某知名大佬给出的猜测,旁路识别出SSL证书后,会开始屏蔽新的连接,几秒后就会解除。幸运的是,元妹在Github上找到了一个开源项目,就是为了帮助大家解决这个问题。使用方法很简单,小白也能操作。该项目不需要安装任何程序。通过修改本地的hosts文件,试图解决:访问GitHub慢的问题GitHub项目中的图片无法显示的问题如何使用首先需要复制以下内容:#GitHub520HostStart185.199.108.154github.githubassets.com140.82.114.21central.github.com185.199.108.133desktop.githubusercontent.com185.199.108.153assets-cdn.github.com185.199.108.133camo.githubusercontent.com185.199.108.133github.map.fastly.net199.194github.global.ssl.fastly.net140.82.113.4gist.github.com185.199.108.153github.io140.82.114.3github.com140.82.113.5api.github.com185.199.108.133raw.githubuserimages.com185.199.108.usercontent.com185.199.108.133favicons.githubusercontent.com185.199.108.133avatars5.githubusercontent.com185.199.108.133avatars4.githubusercontent.com185.199.108.133avatars3.githubusercontent.com185.199.108.133avatars2.githubusercontent.com185.199.108.133avatars1.githubusercontent.com185.199.108.133avatars0.githubusercontent.com185.199.108.133avatars.githubusercontent.com140.82.113.10codeload.github.com52.216.226.40github-cloud.s3.amazonaws.com52.216.162.99github-com.s3.amazonaws.com52.216.142.196github-production-release-asset-2e65be.s3.amazonaws.com52.217.97.236github-productionuser-asset-6210df.s3.amazonaws.com52.217.194.41github-production-repository-file-5c1aeb.s3.amazonaws.com185.199.108.153githubstatus.com64.71.168.201github.community185.199.userUpgithubtimeub8.133#condiat.mediat:2021-03-24T16:06:33+08:00#StarmeGitHuburl:https://github.com/521xueweihan/GitHub520#GitHub520HostEnd接下来需要修改hosts文件。hosts文件的位置在每个系统中都不同。具体如下:Windows系统:C:\Windows\System32\drivers\etc\hostsLinux系统:/etc/hostsMac(苹果电脑)系统:/etc/hostsAndroid(安卓)系统:/system/etc/hostsiPhone(iOS)系统:/etc/hosts修改方法,将第一步的内容复制到文末:Windows使用NotepadLinux,Mac使用Root权限:sudovi/etc/hosts。iPhone和iPad一定要越狱,安卓一定要root。在大多数情况下,它会直接生效。如果没有生效,尝试以下方法刷新DNS:Windows:在CMD窗口输入:ipconfig/flushdnsLinux命令:sudorcnscdrestartMac命令:sudokillall-HUPmDNSResponder是不是觉得超级简单?目前GitHub520在Github上星标4.1K,共计348个分支(Github地址:https://github.com/521xueweihan/GitHub520)如果您的Github在访问时也出现地图破解或加载缓慢等问题,不妨试试。Github520,让你重新爱上Github。