Coder Social home page Coder Social logo

speed-github's Introduction

speed-github

一键解决github在国内加载和下载速度慢的问题:laughing::laughing:

速度慢原因

CDN,Content Distribute Network,可以直译成内容分发网络,CDN解决的是如何将数据快速可靠从源站传递到用户的问题。用户获取数据时,不需要直接从源站获取,通过CDN对于数据的分发,用户可以从一个较优的服务器获取数据,从而达到快速访问,并减少源站负载压力的目的。

但是GitHub的CDN被某墙屏了,由于网络代理商的原因,所以访问下载很慢。

实现原理

直接获取ip地址并绑定本地host,绕过DNS解析。通过脚本获取下列网址ip


	github.com
	github.global.ssl.fastly.net
	assets-cdn.github.com
	documentcloud.github.com
	gist.github.com
	help.github.com
	nodeload.github.com
	raw.github.com
	status.github.com
	training.github.com
	ithubusercontent.com
	avatars1.githubusercontent.com
	codeload.github.com

将获取的ip与对应的网址填入host文件中,然后刷新本地DNS.

运行环境

  • python3+
  • 依赖库
    • BeautifulSoup
    • requests
    • shutil

使用方式

  1. 用记事本或notepad++打开startFly.bat文件,将 var变量值改成你自己存放该项目的地址
  2. 右键点击startFly.bat, 以管理员身份运行

效果图

Ok啦

speed-github's People

Contributors

jvxiao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

speed-github's Issues

请问这个项目还维护吗?最近好像用不了了

为啥issue里不让贴图,上传了没反应的。。点击管理员运行之后的情况如下:

ECHO 处于打开状态。

C:\WINDOWS\system32>set var=D:/111TOOLKIT/speed-github-master

C:\WINDOWS\system32>python D:/111TOOLKIT/speed-github-master/src/speed.py

Windows IP 配置

已成功刷新 DNS 解析缓存。
请按任意键继续. . .

然后host里是这样的:(我运行了三次)

#127.0.0.1 localhost
#::1 localhost

#*github 2021-01-10 更新

#*github 2021-01-10 更新

#*github 2021-01-10 更新

项目启动

windos系统最好是英文文件夹下运行使用
python3.7只要安装beautifulsoup4,由于网速问题推荐先去pypi下载tar包,如beautifulsoup4-4.9.0.tar.gz
pip install beautifulsoup4-4.9.0.tar.gz

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.