GitHub国内加速:利用FastGithub开源软件优化访问
source link: https://51.ruyo.net/18275.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
GitHub国内加速:利用FastGithub开源软件优化访问
这是一个系列的文章:GitHub国内加速 介绍多种方案!
在前不久不知啥原因Github彻底被封掉了。全国PING都被阻断。甚至某些电信网络的DNS直接将github.com跳转到反诈网页。
哎~ 对于国内的部分童鞋来说应该算是一个噩耗。
下面再新增一种方式吧!且用且珍惜了!
目前看来阻断了Github域名解析的大部分IP。不过貌似还有一些漏网的。
比如:140.82.112.3
直接修改Hosts 也能访问Github!
140.82.112.3 github.com
更完整Hosts 请访问:https://51.ruyo.net/test/github_hosts.html
如何能更便捷,更快,找到我们需要的IP呢?这里推荐一个开源仓库!
https://github.com/dotnetcore/FastGithub
- 提供域名的纯净IP解析;
- 提供IP测速并选择最快的IP;
- 提供域名的tls连接自定义配置;
- google的CDN资源替换,解决大量国外网站无法加载js和css的问题;
- 特别提醒:不是代理爬墙访问!!!!
官方仓库提供releases下载。如果你访问不到。可以来下载我这里分流的。
windows-x64桌面
双击运行FastGithub.UI.exe
windows-x64服务
fastgithub.exe start // 以windows服务安装并启动
fastgithub.exe stop // 以windows服务卸载并删除
linux-x64终端
sudo ./fastgithub
设置系统自动代理为http://127.0.0.1:38457,或手动代理http/https为127.0.0.1:38457
linux-x64服务
sudo ./fastgithub start // 以systemd服务安装并启动
sudo ./fastgithub stop // 以systemd服务卸载并删除
设置系统自动代理为http://127.0.0.1:38457,或手动代理http/https为127.0.0.1:38457
macOS-x64
双击运行fastgithub
安装cacert/fastgithub.cer并设置信任
设置系统自动代理为http://127.0.0.1:38457,或手动代理http/https为127.0.0.1:38457
docker-compose一键部署
准备好docker 18.09, docker-compose.
在源码目录下,有一个docker-compose.yaml 文件,专用于在实际项目中,临时使用github.com源码,而做的demo配置。
根据自己的需要更新docker-compose.yaml中的sample和build镜像即可完成拉github.com源码加速,并基于源码做后续的操作。
Linux
1)Linux下载 fastgithub 可执行文件。 直接启动即可。
也可以直接执行下面的脚本,完成运行~
wget https://pan.ruyo.cc/d/%E4%BB%A3%E7%A0%81/FastGithub/fastgithub_linux-x64.zip
unzip fastgithub_linux-x64.zip
cd fastgithub_linux-x64
./fastgithub
启动后输出内容:
[root@VM_centos ~]# ./fastgithub
2022-12-18T22:14:30.4512754+08:00 [INF]
FastGithub.HttpServer.CaCertInstallerOfLinuxRedHat
已自动向系统安装CA证书cacert/fastgithub.crt
2022-12-18T22:14:30.6839719+08:00 [INF]
FastGithub.HttpServer
已监听http://localhost:38457,http代理服务启动完成
2022-12-18T22:14:30.7440714+08:00 [WRN]
FastGithub.DomainResolve.DnscryptProxy
dnscrypt-proxy启动失败:Could not find a part of the path '/root/dnscrypt-proxy/dnscrypt-proxy.toml'.
2022-12-18T22:14:30.8052849+08:00 [INF]
FastGithub.AppHostedService
FastGithub启动完成,当前版本为v2.1.4,访问 https://github.com/dotnetcore/fastgithub 关注新版本
2022-12-18T22:14:30.9060862+08:00 [INF]
Microsoft.Hosting.Lifetime
Now listening on: https://localhost:38443
2022-12-18T22:14:30.9070461+08:00 [INF]
Microsoft.Hosting.Lifetime
Now listening on: http://localhost:3880
2022-12-18T22:14:30.9072494+08:00 [INF]
Microsoft.Hosting.Lifetime
Now listening on: http://localhost:38457
2022-12-18T22:14:30.9087496+08:00 [INF]
Microsoft.Hosting.Lifetime
Application started. Press Ctrl+C to shut down.
2022-12-18T22:14:30.9090075+08:00 [INF]
Microsoft.Hosting.Lifetime
Hosting environment: Production
2022-12-18T22:14:30.9091938+08:00 [INF]
Microsoft.Hosting.Lifetime
Content root path: /root
2)尝试访问Github
[root@VM_centos ~]# wget github.com
--2022-12-18 22:15:15-- http://github.com/
Resolving github.com (github.com)... 20.205.243.166
Connecting to github.com (github.com)|20.205.243.166|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/ [following]
--2022-12-18 22:15:16-- https://github.com/
Connecting to github.com (github.com)|20.205.243.166|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘index.html’
[ <=> ] 222,987 662KB/s in 0.3s
2022-12-18 22:15:16 (662 KB/s) - ‘index.html’ saved [222987]
Windows
1)下载可执行文件,双击【FastGithub.UI.exe】运行即可
2)软件启动成功后,然后电脑就可以访问Github了
3)访问速度还不错。下载文件大概300KB/s
该软件使用起来也比较方便!还是非常不错的一款软件!
唯一的缺点,如果所有的IP都被Q完。那可能这个软件也就......
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK