Code Monkey home page Code Monkey logo

Comments (15)

imyuanx avatar imyuanx commented on June 7, 2024

理论上完全没问题,可以尝试观察下 clash 的日志,确认下 api.openai.com 请求是否走了 clash 的代理,如果没有的需要在 clash 中添加规则

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

这是我服务端的日志信息,没有timeout之类的报错信息,但是客户端就是连接超时
屏幕截图 2023-04-05 151939

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

clash的日志也没有来自openai.com的流量

from chatgpt-proxy.

imyuanx avatar imyuanx commented on June 7, 2024

尝试下 clash 设置为全局代理

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

尝试下 clash 设置为全局代理

我觉得不是clash的问题,我使用curl能够访问到openai,clash也有记录
[root@localhost /]# curl -x http://localhost:7890 https://api.openai.com/v1/engines/davinci/completions { "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 } }

from chatgpt-proxy.

imyuanx avatar imyuanx commented on June 7, 2024

如果你用的是 SSE 链接,那么请求失败会有一个报错输出,可以在程序日志搜索下 catch: 看看有没有报错信息

报错代码见:https://github.com/imyuanx/chatgpt-proxy/blob/main/src/pages/api/proxy-sse.js#L31

from chatgpt-proxy.

imyuanx avatar imyuanx commented on June 7, 2024

另外部署完这个应用后得到的 http://.../proxyhttp://.../proxy-sse 链接代理的地址是 https://api.openai.com,确保你构建的请求路径是正确的

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

另外部署完这个应用后得到的 http://.../proxyhttp://.../proxy-sse 链接代理的地址是 https://api.openai.com,确保你构建的请求路径是正确的

如果你用的是 SSE 链接,那么请求失败会有一个报错输出,可以在程序日志搜索下 catch: 看看有没有报错信息

报错代码见:https://github.com/imyuanx/chatgpt-proxy/blob/main/src/pages/api/proxy-sse.js#L31

好的,我找到了chatgpt-proxy的报错信息
Error: connect ETIMEDOUT 128.242.240.180:443 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16) { errno: -110, code: 'ETIMEDOUT', syscall: 'connect', address: '128.242.240.180', port: 443 }
该项目得到的链接是不会经过clash代理吗,clash没有这个代理项目的日志信息

from chatgpt-proxy.

imyuanx avatar imyuanx commented on June 7, 2024

理论上来说你服务器上的所有流量都是会走 clash 的规则的

from chatgpt-proxy.

Mydong avatar Mydong commented on June 7, 2024

服务器和有没有clash没关系吧 只要服务器是海外的vps就行。
我vps是香港阿里云的。搭建后 啥都没设置

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

服务器和有没有clash没关系吧 只要服务器是海外的vps就行。 我vps是香港阿里云的。搭建后 啥都没设置

没有香港的服务器,想自己搭个项目玩玩,按理来说有代理可以翻墙也行,卡在这了

from chatgpt-proxy.

Mydong avatar Mydong commented on June 7, 2024

服务器和有没有clash没关系吧 只要服务器是海外的vps就行。 我vps是香港阿里云的。搭建后 啥都没设置

没有香港的服务器,想自己搭个项目玩玩,按理来说有代理可以翻墙也行,卡在这了

香港服务器是个隐喻,海外服务器都可以,因为openai是在国内屏蔽了访问,但海外的ip不受国内墙的限制(主要这个服务器ip没有被墙)。

如果你是国内的服务器,搭建的这个项目,例如国内服务器绑定的域名(ip)是xxx1。

那么,你clash上要设置的应该是,xxx1,走clash的代理。


不过,你用国内的vps了,而且有clash了,为啥要搭建这个反代。直接用 api.openai.com 这个挂代理,就行了啊。

我用UP主这个服务,主要就是为了海外vps挂个反代api.openai.com的服务,在国内使用,不用挂代理了。

from chatgpt-proxy.

oishiimikan avatar oishiimikan commented on June 7, 2024

服务器和有没有clash没关系吧 只要服务器是海外的vps就行。 我vps是香港阿里云的。搭建后 啥都没设置

没有香港的服务器,想自己搭个项目玩玩,按理来说有代理可以翻墙也行,卡在这了

香港服务器是个隐喻,海外服务器都可以,因为openai是在国内屏蔽了访问,但海外的ip不受国内墙的限制(主要这个服务器ip没有被墙)。

如果你是国内的服务器,搭建的这个项目,例如国内服务器绑定的域名(ip)是xxx1。

那么,你clash上要设置的应该是,xxx1,走clash的代理。

不过,你用国内的vps了,而且有clash了,为啥要搭建这个反代。直接用 api.openai.com 这个挂代理,就行了啊。

我用UP主这个服务,主要就是为了海外vps挂个反代api.openai.com的服务,在国内使用,不用挂代理了。

我的不是云服务器,是安装的虚拟机,只是想部署一个应用玩玩,主要是我对js不怎么懂,用的别人的项目,不然就自己改代码了。

from chatgpt-proxy.

Mydong avatar Mydong commented on June 7, 2024

服务器和有没有clash没关系吧 只要服务器是海外的vps就行。 我vps是香港阿里云的。搭建后 啥都没设置

没有香港的服务器,想自己搭个项目玩玩,按理来说有代理可以翻墙也行,卡在这了

香港服务器是个隐喻,海外服务器都可以,因为openai是在国内屏蔽了访问,但海外的ip不受国内墙的限制(主要这个服务器ip没有被墙)。

如果你是国内的服务器,搭建的这个项目,例如国内服务器绑定的域名(ip)是xxx1。

那么,你clash上要设置的应该是,xxx1,走clash的代理。

不过,你用国内的vps了,而且有clash了,为啥要搭建这个反代。直接用 api.openai.com 这个挂代理,就行了啊。

我用UP主这个服务,主要就是为了海外vps挂个反代api.openai.com的服务,在国内使用,不用挂代理了。

我的不是云服务器,是安装的虚拟机,只是想部署一个应用玩玩,主要是我对js不怎么懂,用的别人的项目,不然就自己改代码了。

😂😂 那你应该部署个chatgptweb项目。
这个是代理用的。😂😂

from chatgpt-proxy.

Related Issues (18)

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.