Git Product home page Git Product logo

gaboolic / cloudflare-reverse-proxy Goto Github PK

View Code? Open in Web Editor NEW
718.0 8.0 266.0 6.02 MB

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

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

JavaScript 100.00%
chatgpt-proxy cloudflare github-proxy google-proxy openai-proxy reverse-proxy cloudflare-proxy cloudflare-reverse-proxy

cloudflare-reverse-proxy's Issues

把url跳转和密码验证结合了一下,但是写死了只能访问github

https://github.com/nekoaday/cloudflare-reverse-proxy
相当于是结合了两个项目的bug,由于本人不会JavaScript只是ctrlCV工程师
访问除github之外的连接都有问题,希望这样能让墙通融一下
ivesyi的url的encodeURIComponent改了
href,src,action,后面有可能是个完整http(github release里),有可能是一部分(这个原项目解决),还有直接写死你的网址的(github头像)
css没办法,代理了获取不到,于是没管,勉强能用
然后把这几个问题解决了,发现自己的水平已经把github写死代码里了

请求一位正则仙人,以我水平属实不会了

【改进】感谢作者,这里做了一些小小的改进

项目地址:

https://github.com/1234567Yang/cf-proxy-ex/

在线体验:

https://y.demo.wvusd.homes/

轻点薅。

基于原项目的改进:

  • 去掉/proxy/,方便使用。我看到有issue说了,但是作者说想添加引导界面,这个问题我也解决了。
  • 手动处理转跳事件(3XX),防止一些相对资源加载不出来。
  • 判断欲代理的网址是否以http开头,如果不是就自动加上。
  • 把header里所有有关代理网址的信息全部换成要代理的网站的信息,防止某些网站阻止代理。
  • 相对路径全部转换绝对路径,方便加载资源(如JS,CSS等)。
  • Cookie作用域修改成仅当代理那个网站时,防止Cookie太大服务器发来400 bad request,同时也可以防止一个敏感的Cookie被探测到导致整个网站无法使用,详细:#7
  • XMLHttpRequestfetch注入返回的HTML,这样也可以提交表单数据。
  • 把一个文档监视器注入到返回的HTML,这样有新的链接也可以相对转绝对。
  • 修改Content-Security-PolicyX-Frame-Options的Header,实现可代理Duckduckgo,同时也解决了一些网站打不开的问题。
  • 在返回的时候,如果是HTML,那么添加"Content-Type": "text/html; charset=utf-8",防止一些较为古老的中文网站打开出现锟斤拷烫烫烫的问题。
  • 优化了一些代码。

这个方法是不行了吗?一直报错403 Forbidden: "error code: 1010"

直接post “/v1/chat/completions” 是说没有api key
"error": {
"message": "You didn't provide an API key. You need to provide your API key in an Authorization header using Bearer auth (i.e. Authorization: Bearer YOUR_KEY), or as the password field (with blank username) if you're accessing the API from your browser and are prompted for a username and password. You can obtain an API key from https://platform.openai.com/account/api-keys.",
"type": "invalid_request_error",
"param": null,
"code": null
}
给了api key之后报的是:403 Forbidden: "error code: 1010",看上去是被ban了,但是直接用openai的url是可以的

不能自动添加https

在使用反代理后打开链接,除链接本身可以访问。剩下都不行。然后一看访问跳转时是不加https的,就导致了无法加载。

能否url不跳转。

现在只能加速静态url,点击连接后就跳转了。能否加速跳转后的链接呢?

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.