Giter Site home page Giter Site logo

proxy's Introduction

Workers

Workers 和 Vercel 上的代理脚本

More info -> core

一开始是准备只使用 Workers 的, 但是奈何单账户很容易触发 ratelimit, 10ms 的 CPU time 又不足以计算 JWT

后面准备换用 Vercel, 但是发现 Payload 有 Max 5MB 的限制, 所以只好做成现在这样, Vercel 分发 access token, Workers 代理文件

更新后的布局是: 所有链接指向 Vercel, Vercel 再生成 access token 并 302 跳转至 Workers

准备

使用

git clone https://github.com/JAVClub/proxy JAVClub_proxy
cd JAVClub_proxy
cp workers/config.example.js workers/config.js
cp vercel/config.example.js vercel/config.js
cd workers
npm i
cd ../vercel
npm i
npm i -g now webpack webpack-cli

然后部署 Workers, 进入 ./workers 运行 webpack app.js, 将 ./workers/dist/main.js 的内容部署至 Workers 即可

再然后将准备到的 Service Account 文件们复制到本项目的 vercel/accounts 目录下, 然后在 ./vercel 目录下运行 node genTokens.js

接下来更改 ./vercel/config.js 中的 password 字段(对应 core 中表述的 secret)和其余的字段

最后在根目录执行 now 按提示部署至 Vercel 并记下 URL 即可

特殊使用

应要求加了个正常的使用方法 (即使用 refresh_token 获得 access_token)

若要使用这种方法,创建 ./worker/config.js 并填写其中信息后, 将 app.js 的第三行的第一个注释(即 //)去掉即可

免责声明

本程序仅供学习了解, 请于下载后 24 小时内删除, 不得用作任何商业用途, 文字、数据及图片均有所属版权, 如转载须注明来源

使用本程序必循遵守部署服务器所在地、所在国家和用户所在国家的法律法规, 程序作者不对使用者任何不当行为负责

proxy's People

Contributors

lynmoe avatar

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.