Code Monkey home page Code Monkey logo

vercel-reverse-proxy's Introduction

vercel-reverse-proxy

English README

本项目是vercel反向代理。完全免费,万能代理,可代理全网一切接口,包括openai、github、google等等。http和https接口、单页面均可代理,在网络环境不好的情况下均可用。(直接浏览器打开代理页面的情况下,由于某些js和css的路径可能会不对造成访问不到,页面样式有点小问题。)

vercel现在每月有100GB的免费流量。本人又基于cloudflare搞了一个反向代理,仓库地址:cloudflare-reverse-proxy供大家参考,也作为一个备份吧。 我自己的vercel项目部署失败,疑似被ban,各位别直接一键部署了,先fork到自己的仓库改改项目名 删掉readme试试吧。实在不行 移步上面cloudflare项目,cloudflare的格局比较大

部署

Vercel

使用方法

1 部署。部署有两种方法,一是直接点击上方按钮一键部署,二是可以先fork本项目,再登录vercel网站新建。vercel可以通过github一键注册只需要绑定手机号支持cn 新建项目

2 绑定自己的域名(不是必须,使用vercel自带的子域名也可以,但是自带的域名vercel.app在国内网络环境不好的情况下不可用) 可以申请tk免费域名或者薅小域名注册商首年免费羊毛 绑定域名 绑定域名时按照vercel上的说明配置即可,其实就是在你的域名上配了一个子域名,cname到vercel服务器

3 访问 域名/proxy/url 或者/httpproxy/url即可。 映射规则为/proxy/url映射到https接口,/httpproxy/url映射到http接口

示例

例1 访问https://替换为你自己的域名.com/proxy/api.openai.com/v1/chat/completions 实际上会替换为https://api.openai.com/v1/chat/completions demo1

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

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

例2 访问https://替换为你自己的域名.com/proxy/raw.githubusercontent.com/gaboolic/vercel-reverse-proxy/main/vercel.json 实际上会替换为https://raw.githubusercontent.com/gaboolic/vercel-reverse-proxy/main/vercel.json demo2 映射规则为/proxy/url映射到https接口,/httpproxy/url映射到http接口

也可用于github下载加速。假如原始链接是https://objects.githubusercontent.com/github-production-release-asset-2e65be/xxxxxx 改为https://替换为你自己的域名.com/proxy/objects.githubusercontent.com/github-production-release-asset-2e65be/xxxxxx 就可以加速了。下图是github原始链接和加速后对比。可以看到效果杠杠的,每秒50kb小水管变成了每秒2mb的大水管 github-download

例3 访问https://替换为你自己的域名.com/proxy/www.google.com/search?q=vercel-reverse-proxy 实际上会替换为https://www.google.com/search?q=vercel-reverse-proxy demo3 代理google搜索结果页面

vercel-reverse-proxy's People

Contributors

gaboolic avatar norah1to 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar

vercel-reverse-proxy's Issues

过不去了

Reliability: vercel-reverse-proxy
Failed after 5s
一键部署失败啦

请求openai返回的错误,求解决方法?

就和例子那样,改了api_base,然后对话返回这个是什么意思?
msg: { "error": { "message": "Unrecognized request argument supplied: messages"
msg: "type": "invalid_request_error"
msg: "param": null,

Vercel可以突破1000ms的请求时间限制吗【处理请求的时间有限制】

我网上别人说的,我报了这个错误。It appears that your web server has some kind of timeout limit. This can also occur if you are using a VPS, CDN, proxy, firewall, or Cloudflare. To resolve this issue, please contact your hosting provider and request an increase in the timeout limit. Additionally you can enable Custom Prompts for faster response to avoid timeout.
image

如果您使用 Apache,则需要联系您的托管提供商以查找httpd.conf文件中的当前超时值。该值可以增加。

如果您使用 Nginx,则需要联系您的托管提供商以查找/etc/nginx/conf.d/timeout.conf文件中的当前超时值。

浏览器插件自动添加代理前缀

感谢作者分享,但在使用时,总是需要添加自己域名前缀,感觉有点麻烦,我在想是否可以写一个浏览器插件,在访问时自动添加前缀,可以设置需要代理的网站和白名单

请求商务推广合作

作者您好,我们也是一家专业做IP代理的服务商,极速HTTP,我们注册认证会送10000IP(可以帮助您的学者适当薅羊毛试用 :) 。想跟您谈谈是否能够达成商业推广上的合作。如果您,有意愿的话,可以联系我,微信:13982004324 谢谢(如果没有意愿的话,抱歉,打扰了)

访问报错

无法使用,任何url都会返回类似错误信息:
返回:
{
"error": {
"message": "Invalid URL (GET /proxy/www.google.com/search)",
"type": "invalid_request_error",
"param": null,
"code": null
}
}

404

我想请问下,为啥我一键部署页面显示的是404: NOT_FOUND?

访问claud.ai502

502: BAD_GATEWAY
Code: DNS_HOSTNAME_NOT_FOUND
ID: sin1::8x5v4-1691653629620-05218fa02973

希望地址上能用直接加vecel 反代url 前缀的格式,https://替换为你自己的域名.com/https://objects.githubusercontent.com/github-production-release-asset-2e65be/xxxxxx

跳转问题

emm不知道怎么描述,举个例子吧:

访问https://自定义域名/proxy/www.google.com,点击页面上的搜索按钮后会跳转到https://自定义域名/search?q=xxxx,而不是https://自定义域名/proxy/www.google.com/search?q=xxxx,然后毫无悬念地404

502超时

image
像这种访问OpenAi时,因为prompt要求,生成文本的时间过长,导致超时的502应该怎么解决呢。

如何匿名ip呢

最近项目的ip被监控了,访问不了了,如何匿名ip呢

搭好后,我问:介绍下苏东坡。 就挂了

搭好后,我问:介绍下苏东坡。 就挂了

 raise error.APIError(
openai.error.APIError: Invalid response object from API: 'An error occurred with this application.\n\nROUTER_EXTERNAL_TARGET_ERROR\n' (HTTP response code was 502)

但是 我问: 帮我写一个python爬虫 就正常返回。
感觉这个代理方案测试下demo就行了,生产慎重。

还是会404

刚刚Fork过去的,提示如下(vercel的部署状态是Ready):
404: NOT_FOUND
Code: NOT_FOUND
ID: hnd1::q798b-1691403069095-36b33a769e5a

另外在404的情况下,访问http://{ 替换为你自己的域名.com} /httpproxy/www.google.com/search?q=vercel-reverse-proxy 就和没有挂梯子打开 Google一样,提示网页无法加载

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.