Coder Social home page Coder Social logo

tangzixuan / cloudflare-reverse-proxy Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gaboolic/cloudflare-reverse-proxy

0.0 0.0 0.0 6.02 MB

cloudflare反向代理|OpenAI/ChatGPT 免翻墙代理|github免翻墙代理|github下载加速|google代理|cloudflare万能代理

Home Page: https://github.com/gaboolic/vercel-reverse-proxy

JavaScript 100.00%

cloudflare-reverse-proxy's Introduction

cloudflare-reverse-proxy

本项目是cloudflare反向代理。在cloudflare网站中新建worker,把worker.js文件中的内容复制进去即可使用。

使用方法为在任意url前面加上https://你的域名/proxy/ 即可使用cloudflare加速。

例如https://你的域名/proxy/https://raw.githubusercontent.com/gaboolic/cloudflare-reverse-proxy/main/worker.js

本人另外一个项目是基于vercel的反向代理,仓库地址https://github.com/gaboolic/vercel-reverse-proxy 供大家参考

详细步骤

0 登录https://www.cloudflare.com/

1 创建应用程序 创建应用程序 2 创建worker(pages麻烦一点,需要写一个package.json文件,但pages的好处是分配的域名直接可以用) 创建worker 3 点"部署"按钮 创建worker 4 编辑代码 编辑代码 5 把worker.js文件中的内容复制进去,点"保存并部署" 保存并部署 6 (可选) 添加自定义域

绑定自己的域名。不需要教程了,现在在cloudflare点添加自定义域名,输入子域名自动添加好dns

免费域名申请:https://secure.nom.za/ https://nic.eu.org/ https://nic.ua

不需要申请,link域名0元免费1年:dynadot.com

使用方法

在任意url前面加上https://你的域名/proxy/ 即可使用cloudflare加速。

例1 https://github.com/gaboolic 前面加上https://你的域名/proxy/ demo1 例2 调用openai的post接口,https://api.openai.com/v1/chat/completions 前面加https://你的域名/proxy/ demo2

如何在一些常见的开源项目中使用? 一般开源项目都是引用的openai的库,可以看到里面有一个属性是api_base = os.environ.get("OPENAI_API_BASE", "https://api.openai.com/v1")

所以使用的时候只需要设置一下openai.api_base="https://你的域名/proxy/https://api.openai.com/v1" 就可以了

更多使用方法也可以参考https://github.com/gaboolic/vercel-reverse-proxy

cloudflare-reverse-proxy's People

Contributors

chise0713 avatar gaboolic avatar madisonwirtanen avatar whueugene 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.