当前位置: 首页 > news >正文

国内GitHub加速访问工具-Fetch GitHub Hosts

一、工具介绍

Fetch GitHub Hosts是一款开源跨平台的国内GitHub加速访问工具,主要为解决研究及学习人员访问 Github 过慢或其他问题而提供的 Github Hosts 同步工具。

项目原理:是通过部署此项目本身的服务器来获取 github.com 的 hosts,而不是通过第三方ip地址接口来进行获取,例如 ipaddress.com 等。

二、使用方法

图形化界面

软件支持图像化界面操作,不用直接操作hosts,对小白也非常友好且方便

下载完成解压压缩包,运行对应平台的执行文件即可运行(⚠️注意:Linux下需要用进行启动,Windows和MacOS会自动进行提权操作。)

客户端模式

客户端启动 

客户端主机源选择

 客户端主机源自定义

 服务端模式

三、命令行终端 

参数

参数名缩写默认值必填描述
modem启动模式server(服务端)/client(客户端)
intervali60获取记录值间隔(分钟)
portp9898服务模式监听端口以访问HTTP服务
urluhttps://hosts.gitcdn.top/hosts.txt客户端模式远程主机获取链接

启动客户端

注意:

Linux下需要使用运行;sudo

Windows和MacOS会自动进行提权操作。 

  • 直接运行
# Linux/Macos
sudo fetch-github-hosts -m=client# Windows
fetch-github-hosts.exe -m=client
  • 自定义获取时间间隔
# Linux/Macos(10分钟获取一次)
sudo fetch-github-hosts -i=10# Windows(10分钟获取一次)
fetch-github-hosts.exe -i=10
  • 自定义获取链接
# Linux/Macos
sudo fetch-github-hosts -u=http://127.0.0.1:9898/hosts.json# Windows
fetch-github-hosts.exe -u=http://127.0.0.1:9898/hosts.json

启动服务端

  • 直接运行
# Linux/Macos
fetch-github-hosts -m=server# Windows
fetch-github-hosts.exe -m=server
  • 自定义监听端口
# Linux/Macos
fetch-github-hosts -m=server -p=6666# Windows
fetch-github-hosts.exe -m=server -p=6666

手动

 添加主机

将以下全部内容粘贴到你的hosts文件中,即可。

# fetch-github-hosts begin
140.82.112.26               alive.github.com
140.82.114.25               live.github.com
185.199.111.154             github.githubassets.com
140.82.113.21               central.github.com
185.199.110.133             desktop.githubusercontent.com
2606:50c0:8001::153         assets-cdn.github.com
185.199.111.133             camo.githubusercontent.com
185.199.108.133             github.map.fastly.net
151.101.161.194             github.global.ssl.fastly.net
140.82.114.3                gist.github.com
185.199.110.153             github.io
140.82.113.3                github.com
192.0.66.2                  github.blog
140.82.114.5                api.github.com
2606:50c0:8003::154         raw.githubusercontent.com
2606:50c0:8002::154         user-images.githubusercontent.com
185.199.110.133             favicons.githubusercontent.com
185.199.109.133             avatars5.githubusercontent.com
185.199.108.133             avatars4.githubusercontent.com
185.199.110.133             avatars3.githubusercontent.com
185.199.111.133             avatars2.githubusercontent.com
185.199.109.133             avatars1.githubusercontent.com
185.199.111.133             avatars0.githubusercontent.com
2606:50c0:8000::154         avatars.githubusercontent.com
140.82.112.9                codeload.github.com
54.231.171.201              github-cloud.s3.amazonaws.com
3.5.8.134                   github-com.s3.amazonaws.com
52.217.40.244               github-production-release-asset-2e65be.s3.amazonaws.com
52.217.9.60                 github-production-user-asset-6210df.s3.amazonaws.com
52.217.160.97               github-production-repository-file-5c1aeb.s3.amazonaws.com
185.199.109.153             githubstatus.com
140.82.114.18               github.community
52.224.38.193               github.dev
140.82.112.22               collector.github.com
2620:1ec:21::16             pipelines.actions.githubusercontent.com
2606:50c0:8000::154         media.githubusercontent.com
185.199.110.133             cloud.githubusercontent.com
185.199.110.133             objects.githubusercontent.com
# last fetch time: 2023-08-03 10:42:51
# update url: https://hosts.gitcdn.top/hosts.txt
# fetch-github-hosts end
  • Linux / MacOShosts路径:/etc/hosts
  • Windowshosts路径:C:\Windows\System32\drivers\etc\hosts

刷新生效

  • Linux:/etc/init.d/network restart
  • Windows:ipconfig /flushdns
  • Macos:sudo killall -HUP mDNSResponder

Unix/Linux一键使用 

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

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

 四、私有部署

 略

五、国内GitHub加速访问工具GitHub地址

 地址:点击前往下载

http://www.lryc.cn/news/109630.html

相关文章:

  • Webpack5新手入门简单配置
  • 基于ali-oss实现不同类型文件上传不同的bucket
  • 域名校验?反爬界的掩耳盗铃!
  • Cesium 实战教程 - 调整 3dtiles 倾斜摄影大小
  • python机器学习(七)决策树(下) 特征工程、字典特征、文本特征、决策树算法API、可视化、解决回归问题
  • 数据结构与算法中的双向链表
  • 数据安全治理的关键-数据分类分级工具
  • Spring集成Junit
  • Java正则校验密码至少包含:字母数字特殊符号中的2种
  • Stable Diffusion教程(6) - 扩展安装
  • Jenkins通过OpenSSH发布WinServer2016
  • 字母异位词分组 LeetCode热题100
  • 使用angular和electron 构建桌面应用
  • 安达发制造工业迈向智能化:APS高级计划排程助力提升生产效率
  • Flink - sink算子
  • 【项目 线程2】3.5 线程的分离 3.6线程取消 3.7线程属性
  • Filebeat+ELK 部署
  • el-table点击表格某一行添加到URL参数,访问带参URL加载表格内容并滚动到选中行位置 [Vue3] [Element-plus 2.3]
  • 【树】 二叉树 堆与堆排序 平衡(AVL)树 红黑(RB)树
  • 信号平滑或移动平均滤波研究(Matlab代码实现)
  • 黑客技术(网络安全)自学
  • 使用七牛云、阿里云、腾讯云的对象存储上传文件
  • 使用阿里云DataX完成数据同步
  • 《Kali渗透基础》13. 无线渗透(三)
  • python——案例六:判断字符串的长度
  • PC-windows-安卓-Linux音频系统框架概论
  • Web Worker API
  • 1.4 MA多头/空头排列是真的吗?
  • 基于SpringBoot+Vue的CSGO赛事管理系统设计与实现(源码+LW+部署文档等)
  • Android系统APP之SettingsProvider