爱意满满的作品展示区。
just1

Github 文件加速更新,支持 clone 加速

  •  1
     
  •   just1 · Mar 24, 2020 · 8513 views
    This topic created in 2418 days ago, the information mentioned may be changed or developed.

    gh-proxy

    前情提要

    /t/655015

    现在支持了 clone,并且有两种方式可以选择

    1 clone 走 github.com.cnpmjs.org (302) (默认)

    2 clone 走 cloudflare workers

    简介

    利用 Cloudflare Workers 对 github release 、archive 以及项目文件进行加速,并且支持 clone,部署无需服务器且自带 cdn 。

    演示

    https://gh.api.99988866.xyz/

    使用 直接在 copy 出来的文件 url 或者 https clone 地址前加https://gh.api.99988866.xyz/ 即可 比如

    git clone https://gh.api.99988866.xyz/https://github.com/hunshcn/gh-proxy.git
    

    也可以直接访问,在 input 输入

    更多使用方法可以移步我的博客

    代码

    开源于 Github https://github.com/hunshcn/gh-proxy

    Supplement 1  ·  Apr 9, 2020
    20200409 新增 python 版本,可以部署到自己服务器上了 @stille
    25 replies  •  2020-08-04 12:13:39 +08:00
    nl101531
    nl101531
    Mar 24, 2020
    1
    赞一个,这东西有用
    justin2018
    justin2018
    Mar 24, 2020
    2
    刚刚发了一个帖子咨询 如何加速 GitHub 就看到楼主的帖子了 😅 试一试 谢谢楼主分享~
    lework1234
    lework1234
    Mar 24, 2020
    3
    赞
    care
    care
    Mar 24, 2020 via iPhone
    4
    像 composer 这种默认要从 github 拉项目依赖的包管理器这种方式可以使用吗?
    just1
    just1
    OP
    Mar 24, 2020 via Android
    5
    @care 不知道他的工作原理,待我尝试一下
    just1
    just1
    OP
    Mar 24, 2020
    6
    @care #4 只需要将 composer.json 里面在 github.com 网址如上使用规则替换就可以,composer 下载 repositories 事实上是 https 协议的 clone
    0lobster0
    0lobster0
    Mar 25, 2020 via Android
    7
    有个问题请教,Cloudflare Workers 部署的网站,如 jsproxy 。不挂代理访问不上啊,请问你这个部署的可以访问,是怎么回事?
    just1
    just1
    OP
    Mar 25, 2020
    8
    @0lobster0 #7 没遇到过这个问题,workers.dev 我也可以直接访问,不然你尝试绑定一下自己的域名?
    0lobster0
    0lobster0
    Mar 25, 2020 via Android
    9
    @just1 #8 是我自己的问题,workers 那块自己取的名子,换了一个就好了,可能之前名字( 996icu )全网封杀吧🤣
    bbbb
    bbbb
    Mar 25, 2020
    10
    太感谢了,在服务器上想操作的的时候真是太方便了。
    hippieZhou
    hippieZhou
    Mar 27, 2020
    11
    支持,昨天 Clone 一个仓库花费了我一天的时间,每次快要完成的时候就 EOF 了
    neighbads
    neighbads
    Mar 27, 2020
    12
    配置自定义域名后是不是有问题。一直 523
    just1
    just1
    OP
    Mar 27, 2020
    13
    @neighbads #12 你指的自定义域名是?正常部署不需要修改代码任何部分
    neighbads
    neighbads
    Mar 27, 2020
    14
    Worker 页面配置了自定义域名,cname 转到 worker 地址 https://gh.api.99988866.xyz
    just1
    just1
    OP
    Mar 27, 2020
    15
    @neighbads #14 自带的 dev 域名应该可以使用吧?
    如果要自定义域名,到域名的 workers 那里添加路由配置 sub.youdomain.com/*到你的 worker,然后还是得为 sub 指定一个 A 记录不然不签发 ssl 证书
    neighbads
    neighbads
    Mar 27, 2020
    16
    @just1 #15 ok 解决了,忘记在后面加 /* 了,感谢
    chich14
    chich14
    Mar 28, 2020
    17
    试用了一下,很方便,赞一个
    INTEL2333
    INTEL2333
    Apr 4, 2020
    18
    不错不错,比 jsproxy 方便
    stille
    stille
    Apr 8, 2020
    19
    这个能部署到 vps 么? 求教程
    avenger
    avenger
    Apr 22, 2020
    20
    感谢楼主,请问支持私有 repo 吗?
    huyinjie
    huyinjie
    Jul 9, 2020
    21
    感谢楼主 请问是否能支持下类似 https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh 的加速,某些云服务连接不上
    lxk11153
    lxk11153
    Aug 4, 2020
    22
    "warning: redirecting to" 是怎么了?
    lxk11153
    lxk11153
    Aug 4, 2020
    24
    @just1 #23 不过现在又快起来了,之前有次几 kb/s
    > git clone --depth 1 'https://gh.api.99988866.xyz/https://github.com/DaHMao/SameCourse.git'
    Cloning into 'SameCourse'...
    warning: redirecting to https://github.com.cnpmjs.org/DaHMao/SameCourse.git/

    > git clone 'https://gh.api.99988866.xyz/https://github.com/DaHMao/SameCourse.git'
    Cloning into 'SameCourse'...
    warning: redirecting to https://github.com.cnpmjs.org/DaHMao/SameCourse.git/
    just1
    just1
    OP
    Aug 4, 2020
    25
    @lxk11153 #24 因为演示站就是重定向到 cnpmjs 的镜像,这个是香港阿里云,国内访问正常会比 cf 快,这个 warning 可以无视,是正确的
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1524 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 56ms · UTC 00:38 · PVG 08:38 · LAX 16:38 · JFK 19:38
    ♥ Do have faith in what you're doing.