diff --git a/index-template.php b/index-template.php index d5507b8..54878e5 100644 --- a/index-template.php +++ b/index-template.php @@ -4,32 +4,67 @@ - Fetch Github IP + Fetch Github Hosts -

说明

-此服务为解决研究及学习人员访问 Github 过慢或其他问题而提供的免费的 Github hosts 同步服务,严禁用于任何非法用途,此服务仅供学习交流。 -

最近获取时间: - +

介绍

+

fetch-github-hosts是主要为解决研究及学习人员访问Github过慢或其他问题而提供的免费的Github hosts同步服务。

+

本项目部分参考于 Github520 , + 但与之不同的是前者是通过ipaddress.com获取github.comhosts, + 而此项目是通过部署本身的服务器来获取github.comhosts,所以在IP节点上会存在一定的差异。

+

最近获取时间: + -   - [hosts.txt] - [hosts.json] -

-

使用方法

-

Unix/Linux

-sed -i "/# fetch-github-hosts begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts -

提示:可以设置定时任务定时获取更新即可

-

Chrome

-使用 FasterHosts 插件 -

Windows/MacOS及其他桌面端

-使用 SwitchHosts 程序,添加远程规则即可,远程地址为:https://hosts.gitcdn.top/hosts.txt -

仓库

-https://github.com/Licoy/fetch-github-hosts -

开源协议

-GPL 3.0 -

+   + [hosts.txt] + [hosts.json] +

+

使用方法

+

手动

+

添加hosts

+

访问 https://hosts.gitcdn.top/hosts.txt , + 将其全部内容粘贴到你的hosts文件中,即可。

+ +

刷新生效

+ +

Unix/Linux 一键使用

+
sed -i "/# fetch-github-hosts begin/Q" /etc/hosts && curl https://hosts.gitcdn.top/hosts.txt >> /etc/hosts
+
+
+

提示:可以设置crontab定时任务定时获取更新即可,解放双手!

+
+

Chrome

+

使用 FasterHosts 插件,若访问速度过慢可以直接使用 + 点击此处 来进行下载。

+

下载完成之后解压压缩包,Chrome地址栏输入chrome://extensions/回车进入,勾选开发者模式,选择加载已解压的扩展程序, + 选择刚才的解压目录即可。

+

Windows /MacOS 及其他桌面端

+

使用 SwitchHosts 桌面端应用,安装添加新规则:

+ +

私有部署

+

下载本仓库的代码:fetch-github-hosts.zip , + 部署到任意一个含有PHP环境的服务器即可,部署完成之后可以计划任务脚本定时更新hosts:

+
cd /wwwroot/fetch-github-hosts #此处更换为你部署的项目路径
+php fetch_hosts.php
+
+
+

注意:必须部署到非大陆的服务器节点!

+
+

开源协议

+

GPL 3.0