[Chanzhaoyu/chatgpt-web]分享一个自建代理(支持 accessToken 和 apiKey)

2024-05-20 985 views
4

摸索出来的,用了一段时间,目前还可以用,能过 Cloudflare 403:linweiyuan/chatgpt-proxy-server,或者 Access deniedlinweiyuan/chatgpt-proxy-server-warp

可以用现成的镜像,也可以自己打包,有 Java 和 Go 实现的 API,开源

除了官方 429,没有速率限制,但可能会不稳定,可能会突然失效(失效会尝试更新)

适合自建自用的场景(多人用会有各种问题) 已修复,目前可以一个服务多人共用

结合本项目,可以这样使用(如果没有 Access denied,则无需启动 chatgpt-proxy-server-warp

version: '3'

services:
  app:
    image: chenzhaoyu94/chatgpt-web # 总是使用 latest ,更新时重新 pull 该 tag 镜像即可
    ports:
      - 3002:3002
    environment:
      # 二选一
      OPENAI_API_KEY:
      # 二选一
      OPENAI_ACCESS_TOKEN: eyJxxx
      # API接口地址,可选,设置 OPENAI_API_KEY 时可用
      OPENAI_API_BASE_URL:
      # API模型,可选,设置 OPENAI_API_KEY 时可用,https://platform.openai.com/docs/models
      # gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, code-davinci-002
      OPENAI_API_MODEL:
      # 反向代理,可选
      API_REVERSE_PROXY: http://go-chatgpt-api:8080/conversation
      # 访问权限密钥,可选
      AUTH_SECRET_KEY:
      # 每小时最大请求次数,可选,默认无限
      MAX_REQUEST_PER_HOUR: 0
      # 超时,单位毫秒,可选
      TIMEOUT_MS: 60000
      # Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
      SOCKS_PROXY_HOST:
      # Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
      SOCKS_PROXY_PORT:
      # HTTPS 代理,可选,支持 http,https,socks5
      HTTPS_PROXY:
    depends_on:
      - go-chatgpt-api

  go-chatgpt-api:
    container_name: go-chatgpt-api
    image: linweiyuan/go-chatgpt-api
    environment:
      - GIN_MODE=release
      - CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515
      - NETWORK_PROXY_SERVER=socks5://chatgpt-proxy-server-warp:65535
    depends_on:
      - chatgpt-proxy-server
      - chatgpt-proxy-server-warp
    restart: unless-stopped

  chatgpt-proxy-server:
    container_name: chatgpt-proxy-server
    image: linweiyuan/chatgpt-proxy-server
    environment:
      - LOG_LEVEL=INFO
    restart: unless-stopped

  chatgpt-proxy-server-warp:
    container_name: chatgpt-proxy-server-warp
    image: linweiyuan/chatgpt-proxy-server-warp
    environment:
      - LOG_LEVEL=INFO
    restart: unless-stopped

终端 docker-compose up -d

回答

5
  • NETWORK_PROXY_SERVER=http://host:port
  • NETWORK_PROXY_SERVER=socks5://host:port 请问这两个字段是国内服务器写代理的地方吗?
4

大佬 NB

7
  • NETWORK_PROXY_SERVER=http://host:port
  • NETWORK_PROXY_SERVER=socks5://host:port 请问这两个字段是国内服务器写代理的地方吗?

对,请求 -> 自建 API -> 这两个字段 -> ChatGPT API

9

赞,好东西!

@linweiyuan 找了一下,没发现 linweiyuan/chatgpt-proxy-server 这个docker 的源码?

6

确实,会考虑开源吗?

0

赞,好东西!

@linweiyuan 找了一下,没发现 linweiyuan/chatgpt-proxy-server 这个docker 的源码?

确实,会考虑开源吗?

仔细看会发现第一行就是 Dockerfile 的链接

7

@linweiyuan 对作者博客上面视频是怎么制作,怎么托管的比较好奇

m3u8,ts文件是怎么制作的?

个人博客解决方案是video标签引入mp4之类的方法,或者上传到bilibili,再iframe引入

1

nginx 反向代理 OpenAI 之前好好,最近突然报502错误,有人遇到这个问题吗?

0

@linweiyuan 对作者博客上面视频是怎么制作,怎么托管的比较好奇

m3u8,ts文件是怎么制作的?

个人博客解决方案是video标签引入mp4之类的方法,或者上传到bilibili,再iframe引入

录屏:OBS 视频切片:FFmpeg(这个可以问下 ChatGPT,会给一堆参数出来,并且解释每个参数的意思) 托管:任何一个支持静态资源访问的都可以,比如跑个 Nginx Hexo 插件:hexo-tag-videojs

MP4 不好在于动不动要加载很大的文件,进度条也不好拖

我一开始也上传到B站,有一次审核说我视频有广告,问在哪又不说,申诉也没用,我再也不用了

5

你好: 图片 几个容器启动成功。可是浏览器访问ip:300时,打不开页面,报错是链接超时。 OPENAI_ACCESS_TOKEN已添加;

  • NETWORK_PROXY_SERVER=http://host:port
  • NETWORK_PROXY_SERVER=socks5://host:port 这两个地方已改为相应代理地址。 请教下可能是哪里的问题,多谢

如果 NETWORK_PROXY_SERVER 是本地的地址,考虑是否写成 127.0.0.1 之类的

可以看下 go-chatgpt-api 的启动日志,有没有 Welcome to ChatGPT 的字样,有才正常

0

我服务器是独立的国外IP,经常出现验证码不通过。日志如下: go-chatgpt-api | INFO[0030] Retry to check captcha
go-chatgpt-api | INFO[0061] Retry to check captcha
go-chatgpt-api | INFO[0061] Switch frame
go-chatgpt-api | INFO[0061] Retry to click captcha
go-chatgpt-api | INFO[0063] Retry to click captcha
go-chatgpt-api | INFO[0066] Retry to click captcha
go-chatgpt-api | INFO[0097] Retry to click captcha
go-chatgpt-api | ERRO[0097] Failed to handle captcha

有时候也能通过 go-chatgpt-api | INFO[0011] Retry to check captcha
go-chatgpt-api | INFO[0013] Retry to check captcha
go-chatgpt-api | INFO[0015] Retry to check captcha
go-chatgpt-api | INFO[0017] Retry to check captcha
go-chatgpt-api | INFO[0019] Retry to check captcha
go-chatgpt-api | INFO[0021] Retry to check captcha
go-chatgpt-api | INFO[0023] Retry to check captcha
go-chatgpt-api | INFO[0025] Retry to check captcha
go-chatgpt-api | INFO[0027] Retry to check captcha
go-chatgpt-api | INFO[0029] Retry to check captcha
go-chatgpt-api | INFO[0031] Retry to check captcha
go-chatgpt-api | INFO[0031] Switch frame
go-chatgpt-api | INFO[0031] Captcha is clicked!

有没有什么好的处理办法,可以优化下吗?

另外我发现都是 一段时间没操作就会出现要求验证码 go-chatgpt-api | WARN[2656] Session timeout, need to refresh
go-chatgpt-api | INFO[2661] Retry to check captcha
go-chatgpt-api | INFO[2663] Retry to check captcha
go-chatgpt-api | INFO[2665] Retry to check captcha

有没有办法可以让会话保持久一点?或者自动刷新下?

2

请问一下,我按照给出的docker-compose文件进行了操作,修改了我的access_token并运行docker容器,但是请求还是始终无响应,可能是什么原因造成的呢?

2

我服务器是独立的国外IP,经常出现验证码不通过。日志如下: go-chatgpt-api | INFO[0030] Retry to check captcha go-chatgpt-api | INFO[0061] Retry to check captcha go-chatgpt-api | INFO[0061] Switch frame go-chatgpt-api | INFO[0061] Retry to click captcha go-chatgpt-api | INFO[0063] Retry to click captcha go-chatgpt-api | INFO[0066] Retry to click captcha go-chatgpt-api | INFO[0097] Retry to click captcha go-chatgpt-api | ERRO[0097] Failed to handle captcha

有时候也能通过 go-chatgpt-api | INFO[0011] Retry to check captcha go-chatgpt-api | INFO[0013] Retry to check captcha go-chatgpt-api | INFO[0015] Retry to check captcha go-chatgpt-api | INFO[0017] Retry to check captcha go-chatgpt-api | INFO[0019] Retry to check captcha go-chatgpt-api | INFO[0021] Retry to check captcha go-chatgpt-api | INFO[0023] Retry to check captcha go-chatgpt-api | INFO[0025] Retry to check captcha go-chatgpt-api | INFO[0027] Retry to check captcha go-chatgpt-api | INFO[0029] Retry to check captcha go-chatgpt-api | INFO[0031] Retry to check captcha go-chatgpt-api | INFO[0031] Switch frame go-chatgpt-api | INFO[0031] Captcha is clicked!

有没有什么好的处理办法,可以优化下吗?

另外我发现都是 一段时间没操作就会出现要求验证码 go-chatgpt-api | WARN[2656] Session timeout, need to refresh go-chatgpt-api | INFO[2661] Retry to check captcha go-chatgpt-api | INFO[2663] Retry to check captcha go-chatgpt-api | INFO[2665] Retry to check captcha

有没有办法可以让会话保持久一点?或者自动刷新下?

可能 IP 有问题,被 CF 重点关注了

如果你直接网页版访问,是不是也会频繁触发人机验证?如果是,更加坐实代理 IP 有问题

我这边很多节点都是刷新一下就过了,有些节点过几个小时再用都不会触发验证码


刚修改了一些验证码处理配置,失败时打印网页信息,可以重拉镜像试下,到时可以贴出来,看究竟发生了什么,里面没有敏感信息


之前是做定时刷新的,但是如果在对话过程中刚好触发定时刷新,对话会直接中断,导致 bug 的感觉,后面改了被动刷新

我这边被动刷新也是几秒就过了,美国的 VPS

最好是找个时间提供下你的网络代理配置,连上去 debug 下

2

nginx 反向代理 OpenAI 之前好好,最近突然报502错误,有人遇到这个问题吗?

需要提供多点信息

5

请问一下,我按照给出的docker-compose文件进行了操作,修改了我的access_token并运行docker容器,但是请求还是始终无响应,可能是什么原因造成的呢?

需要提供多点信息

7

我服务器是独立的国外IP,经常出现验证码不通过。日志如下: go-chatgpt-api | INFO[0030] Retry to check captcha go-chatgpt-api | INFO[0061] Retry to check captcha go-chatgpt-api | INFO[0061] Switch frame go-chatgpt-api | INFO[0061] Retry to click captcha go-chatgpt-api | INFO[0063] Retry to click captcha go-chatgpt-api | INFO[0066] Retry to click captcha go-chatgpt-api | INFO[0097] Retry to click captcha go-chatgpt-api | ERRO[0097] Failed to handle captcha 有时候也能通过 go-chatgpt-api | INFO[0011] Retry to check captcha go-chatgpt-api | INFO[0013] Retry to check captcha go-chatgpt-api | INFO[0015] Retry to check captcha go-chatgpt-api | INFO[0017] Retry to check captcha go-chatgpt-api | INFO[0019] Retry to check captcha go-chatgpt-api | INFO[0021] Retry to check captcha go-chatgpt-api | INFO[0023] Retry to check captcha go-chatgpt-api | INFO[0025] Retry to check captcha go-chatgpt-api | INFO[0027] Retry to check captcha go-chatgpt-api | INFO[0029] Retry to check captcha go-chatgpt-api | INFO[0031] Retry to check captcha go-chatgpt-api | INFO[0031] Switch frame go-chatgpt-api | INFO[0031] Captcha is clicked! 有没有什么好的处理办法,可以优化下吗? 另外我发现都是 一段时间没操作就会出现要求验证码 go-chatgpt-api | WARN[2656] Session timeout, need to refresh go-chatgpt-api | INFO[2661] Retry to check captcha go-chatgpt-api | INFO[2663] Retry to check captcha go-chatgpt-api | INFO[2665] Retry to check captcha 有没有办法可以让会话保持久一点?或者自动刷新下?

可能 IP 有问题,被 CF 重点关注了

如果你直接网页版访问,是不是也会频繁触发人机验证?如果是,更加坐实代理 IP 有问题

我这边很多节点都是刷新一下就过了,有些节点过几个小时再用都不会触发验证码

刚修改了一些验证码处理配置,失败时打印网页信息,可以重拉镜像试下,到时可以贴出来,看究竟发生了什么,里面没有敏感信息

之前是做定时刷新的,但是如果在对话过程中刚好触发定时刷新,对话会直接中断,导致 bug 的感觉,后面改了被动刷新

我这边被动刷新也是几秒就过了,美国的 VPS

最好是找个时间提供下你的网络代理配置,连上去 debug 下

现在这个是阿里云的英国的机器,在这个机器上使用网页版比较少,长时间不用会有验证码,我实际上是在上面配置了一个socks5代理,然后go-chatgpt-api配置使用代理,不知道会不会有影响,然后换个IP看看。

9

docker network create chatgpt-net

docker run --name chatgpt-proxy-server --network chatgpt-net -d linweiyuan/chatgpt-proxy-server

docker run --name go-chatgpt-api --network chatgpt-net -d -p 8080:8080 -e GIN_MODE=release -e CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515 --restart unless-stopped linweiyuan/go-chatgpt-api

docker run -d --name chatgpt-web4 -p 3002:3002 -e OPENAI_API_MODEL=gpt-4 -e API_REVERSE_PROXY=http://go-chatgpt-api:8080/conversation -e OPENAI_ACCESS_TOKEN=token chenzhaoyu94/chatgpt-web

各位大佬 我的服务器在美国,这样语句部署的 目前不行,请问哪里不对吗?

1

我服务器是独立的国外IP,经常出现验证码不通过。日志如下: go-chatgpt-api | INFO[0030] Retry to check captcha go-chatgpt-api | INFO[0061] Retry to check captcha go-chatgpt-api | INFO[0061] Switch frame go-chatgpt-api | INFO[0061] Retry to click captcha go-chatgpt-api | INFO[0063] Retry to click captcha go-chatgpt-api | INFO[0066] Retry to click captcha go-chatgpt-api | INFO[0097] Retry to click captcha go-chatgpt-api | ERRO[0097] Failed to handle captcha 有时候也能通过 go-chatgpt-api | INFO[0011] Retry to check captcha go-chatgpt-api | INFO[0013] Retry to check captcha go-chatgpt-api | INFO[0015] Retry to check captcha go-chatgpt-api | INFO[0017] Retry to check captcha go-chatgpt-api | INFO[0019] Retry to check captcha go-chatgpt-api | INFO[0021] Retry to check captcha go-chatgpt-api | INFO[0023] Retry to check captcha go-chatgpt-api | INFO[0025] Retry to check captcha go-chatgpt-api | INFO[0027] Retry to check captcha go-chatgpt-api | INFO[0029] Retry to check captcha go-chatgpt-api | INFO[0031] Retry to check captcha go-chatgpt-api | INFO[0031] Switch frame go-chatgpt-api | INFO[0031] Captcha is clicked! 有没有什么好的处理办法,可以优化下吗? 另外我发现都是 一段时间没操作就会出现要求验证码 go-chatgpt-api | WARN[2656] Session timeout, need to refresh go-chatgpt-api | INFO[2661] Retry to check captcha go-chatgpt-api | INFO[2663] Retry to check captcha go-chatgpt-api | INFO[2665] Retry to check captcha 有没有办法可以让会话保持久一点?或者自动刷新下?

可能 IP 有问题,被 CF 重点关注了 如果你直接网页版访问,是不是也会频繁触发人机验证?如果是,更加坐实代理 IP 有问题 我这边很多节点都是刷新一下就过了,有些节点过几个小时再用都不会触发验证码 刚修改了一些验证码处理配置,失败时打印网页信息,可以重拉镜像试下,到时可以贴出来,看究竟发生了什么,里面没有敏感信息 之前是做定时刷新的,但是如果在对话过程中刚好触发定时刷新,对话会直接中断,导致 bug 的感觉,后面改了被动刷新 我这边被动刷新也是几秒就过了,美国的 VPS 最好是找个时间提供下你的网络代理配置,连上去 debug 下

现在这个是阿里云的英国的机器,在这个机器上使用网页版比较少,长时间不用会有验证码,我实际上是在上面配置了一个socks5代理,然后go-chatgpt-api配置使用代理,不知道会不会有影响,然后换个IP看看。

root-app-1 | Server is running on port 3002 go-chatgpt-api | INFO[0007] Checking captcha
go-chatgpt-api | INFO[0010] Captcha is clicked!
go-chatgpt-api | WARN[0602] Session timeout, need to refresh
go-chatgpt-api | INFO[0608] Checking captcha
go-chatgpt-api | ERRO[0616] Failed to handle captcha: timeout after 8.054955765s go-chatgpt-api | ERRO[0616]

这是从日志中看到的一个错误信息。 @linweiyuan

5

请问一下,我按照给出的docker-compose文件进行了操作,修改了我的access_token并运行docker容器,但是请求还是始终无响应,可能是什么原因造成的呢?

需要提供多点信息 界面显示是报错:undefind,fetch failed 查看logs是 TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11413:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fetchSSE (file:///app/node_modules/.pnpm/chatgpt@5.1.2/node_modules/chatgpt/build/index.js:46:15) { cause: Error: connect ECONNREFUSED 172.22.0.3:8080 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '172.22.0.3', port: 8080 } } go-chatgpt-api 提示 Retry to check captcha,看来是账号安全问题了

8

按这个代码操作, image 这俩容器运行不起来

8

,exec /app/go-chatgpt-api: exec format error 2exec ./undetected_chromedriver: exec format error

7

docker network create chatgpt-net

docker run --name chatgpt-proxy-server --network chatgpt-net -d linweiyuan/chatgpt-proxy-server

docker run --name go-chatgpt-api --network chatgpt-net -d -p 8080:8080 -e GIN_MODE=release -e CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515 --restart unless-stopped linweiyuan/go-chatgpt-api

docker run -d --name chatgpt-web4 -p 3002:3002 -e OPENAI_API_MODEL=gpt-4 -e API_REVERSE_PROXY=http://go-chatgpt-api:8080/conversation -e OPENAI_ACCESS_TOKEN=token chenzhaoyu94/chatgpt-web

各位大佬 我的服务器在美国,这样语句部署的 目前不行,请问哪里不对吗?

最后的服务加上 --network chatgpt-net 就可以了

8

我服务器是独立的国外IP,经常出现验证码不通过。日志如下: go-chatgpt-api | INFO[0030] Retry to check captcha go-chatgpt-api | INFO[0061] Retry to check captcha go-chatgpt-api | INFO[0061] Switch frame go-chatgpt-api | INFO[0061] Retry to click captcha go-chatgpt-api | INFO[0063] Retry to click captcha go-chatgpt-api | INFO[0066] Retry to click captcha go-chatgpt-api | INFO[0097] Retry to click captcha go-chatgpt-api | ERRO[0097] Failed to handle captcha 有时候也能通过 go-chatgpt-api | INFO[0011] Retry to check captcha go-chatgpt-api | INFO[0013] Retry to check captcha go-chatgpt-api | INFO[0015] Retry to check captcha go-chatgpt-api | INFO[0017] Retry to check captcha go-chatgpt-api | INFO[0019] Retry to check captcha go-chatgpt-api | INFO[0021] Retry to check captcha go-chatgpt-api | INFO[0023] Retry to check captcha go-chatgpt-api | INFO[0025] Retry to check captcha go-chatgpt-api | INFO[0027] Retry to check captcha go-chatgpt-api | INFO[0029] Retry to check captcha go-chatgpt-api | INFO[0031] Retry to check captcha go-chatgpt-api | INFO[0031] Switch frame go-chatgpt-api | INFO[0031] Captcha is clicked! 有没有什么好的处理办法,可以优化下吗? 另外我发现都是 一段时间没操作就会出现要求验证码 go-chatgpt-api | WARN[2656] Session timeout, need to refresh go-chatgpt-api | INFO[2661] Retry to check captcha go-chatgpt-api | INFO[2663] Retry to check captcha go-chatgpt-api | INFO[2665] Retry to check captcha 有没有办法可以让会话保持久一点?或者自动刷新下?

可能 IP 有问题,被 CF 重点关注了 如果你直接网页版访问,是不是也会频繁触发人机验证?如果是,更加坐实代理 IP 有问题 我这边很多节点都是刷新一下就过了,有些节点过几个小时再用都不会触发验证码 刚修改了一些验证码处理配置,失败时打印网页信息,可以重拉镜像试下,到时可以贴出来,看究竟发生了什么,里面没有敏感信息 之前是做定时刷新的,但是如果在对话过程中刚好触发定时刷新,对话会直接中断,导致 bug 的感觉,后面改了被动刷新 我这边被动刷新也是几秒就过了,美国的 VPS 最好是找个时间提供下你的网络代理配置,连上去 debug 下

现在这个是阿里云的英国的机器,在这个机器上使用网页版比较少,长时间不用会有验证码,我实际上是在上面配置了一个socks5代理,然后go-chatgpt-api配置使用代理,不知道会不会有影响,然后换个IP看看。

root-app-1 | Server is running on port 3002 go-chatgpt-api | INFO[0007] Checking captcha go-chatgpt-api | INFO[0010] Captcha is clicked! go-chatgpt-api | WARN[0602] Session timeout, need to refresh go-chatgpt-api | INFO[0608] Checking captcha go-chatgpt-api | ERRO[0616] Failed to handle captcha: timeout after 8.054955765s go-chatgpt-api | ERRO[0616]

这是从日志中看到的一个错误信息。 @linweiyuan

如果在英国直连会发生什么

这个日志本来预期是个 html,但是现在是 js,有点难看出背后的原因,要查查相关资料

0

NETWORK_PROXY_SERVER=http://host:port/ NETWORK_PROXY_SERVER=socks5://host:port 我配了本机的代理地址,报错request to http://go-chatgpt-api:8080/conversation failed, reason: socket hang up

这两个只需配一个,本机代理不能写 127,会指向容器自己

8

请问一下,我按照给出的docker-compose文件进行了操作,修改了我的access_token并运行docker容器,但是请求还是始终无响应,可能是什么原因造成的呢?

需要提供多点信息 界面显示是报错:undefind,fetch failed 查看logs是 TypeError: fetch failed at Object.fetch (node:internal/deps/undici/undici:11413:11) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async fetchSSE (file:///app/node_modules/.pnpm/chatgpt@5.1.2/node_modules/chatgpt/build/index.js:46:15) { cause: Error: connect ECONNREFUSED 172.22.0.3:8080 at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) { errno: -111, code: 'ECONNREFUSED', syscall: 'connect', address: '172.22.0.3', port: 8080 } } go-chatgpt-api 提示 Retry to check captcha,看来是账号安全问题了

你的节点是哪个国家或地区,有条件换个试试

7

�,exec /app/go-chatgpt-api: exec format error �2exec ./undetected_chromedriver: exec format error

你的是什么电脑系统和 CPU

4

修改了docker-compose.yml中如下参数 OPENAI_API_MODEL OPENAI_ACCESS_TOKEN AUTH_SECRET_KEY 其他原封不动的使用了docker-compose的配置

容器go-chatgpt-api 错误: panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x7ae222]

goroutine 1 [running]: github.com/linweiyuan/go-chatgpt-api/webdriver.LoadPageAndHandleCaptcha() /app/webdriver/webdriver.go:48 +0x22 github.com/linweiyuan/go-chatgpt-api/webdriver.init.0() /app/webdriver/webdriver.go:41 +0x2e5 panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0xe8 pc=0x7ae222]

容器chatgpt-proxy-server 错误: Starting ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) on port 9515 All remote connections are allowed. Use an allowlist instead! Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. [1680496892.207][SEVERE]: pthread_create: Operation not permitted (1) Starting ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) on port 9515 All remote connections are allowed. Use an allowlist instead! Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. [1680496899.989][SEVERE]: pthread_create: Operation not permitted (1)

请问是配置不正确吗,还是其他原因,这是一台amd64的甲骨文云(1h2G)

0

如果在英国直连会发生什么 这个日志本来预期是个 html,但是现在是 js,有点难看出背后的原因,要查查相关资料 那个是windows的服务器 不大好操作,我试试看 是一个html,不过里面只有一个script 图片

1

docker network create chatgpt-net docker run --name chatgpt-proxy-server --network chatgpt-net -d linweiyuan/chatgpt-proxy-server docker run --name go-chatgpt-api --network chatgpt-net -d -p 8080:8080 -e GIN_MODE=release -e CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515 --restart unless-stopped linweiyuan/go-chatgpt-api docker run -d --name chatgpt-web4 -p 3002:3002 -e OPENAI_API_MODEL=gpt-4 -e API_REVERSE_PROXY=http://go-chatgpt-api:8080/conversation -e OPENAI_ACCESS_TOKEN=token chenzhaoyu94/chatgpt-web 各位大佬 我的服务器在美国,这样语句部署的 目前不行,请问哪里不对吗?

最后的服务加上 --network chatgpt-net 就可以了 image

go-chatgpt-api的服务报错了

1

NETWORK_PROXY_SERVER=http://host:port/ NETWORK_PROXY_SERVER=socks5://host:port 我配了本机的代理地址,报错request to http://go-chatgpt-api:8080/conversation failed, reason: socket hang up

这两个只需配一个,本机代理不能写 127,会指向容器自己

搞定了,感谢大佬

3

@EvanDbg 没初始化成功,尝试过重启服务也不行?

6

@starsliao 有图形界面就好办,下个 Chrome,然后下那个 undetected_chromedriver 本地跑起来,接着进 API 代码里注释掉 headless 模式,就可以很方便利用浏览器调试,看下这个验证码该如何处理

8

@Timoshao 看报的错说参数少了个括号,这个有点难调试,你是自己用还是多人共用

5

@linweiyuan 大佬,有想法搞个群吗?让无家可归的人有方向,大家群里交流也更方便?

1

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api
7

@linweiyuan 大佬,有想法搞个群吗?让无家可归的人有方向,大家群里交流也更方便?

人少尴尬,人多难搞

1

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api

这样一看不知道代理服务是否暴露 9515 端口出来,方便的话你可以贴完全部 docker 命令,敏感信息去掉,然后把日志也贴一下

4

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api

这样一看不知道代理服务是否暴露 9515 端口出来,方便的话你可以贴完全部 docker 命令,敏感信息去掉,然后把日志也贴一下

。。嗯..可是没什么隐私部分啊 .. 不就是这两条吗...一条chatgpt-proxy-server一条go的

我先一样的写法run了一下你的chatgpt-proxy-server这个镜像,映射了9515,看了一下portainer后台正常运行,然后就跑go的。因为chatgpt-proxy-server没问题所以就没有反复复制粘贴写这个代码就没贴出来。反正这里是正常的我才下一步。

就用上面的代码跑go,结果portainer看是红色的没启动,设置了 restart: unless-stopped才能启动,但是映射的端口也没有了我感觉应该是启动失败了不知道是哪个参数出问题了。

我curl过9515是有数据出来,不过数据很奇怪,,是下面这样不知道是不是正常

{"value":{"error":"unknown command","message":"unknown command: unknown command: ","stacktrace":"#0 0x5facacc6d243 \u003Cunknown>\n#1 0x5facaca317a6 \u003Cunknown>\n#2 0x5facaca8ab2e \u003Cunknown>\n#3 0x5facaca8a797 \u003Cunknown>\n#4 0x5facaca02153 \u003Cunknown>\n#5 0x5facaccc1d5e \u003Cunknown>\n#6 0x5facaccc5a80 \u003Cunknown>\n#7 0x5facacca78b0 \u003Cunknown>\n#8 0x5facaccc6b63 \u003Cunknown>\n#9 0x5facacc98f75 \u003Cunknown>\n#10 0x5facaca006f2 \u003Cunknown>\n#11 0x71fbd3505790 \u003Cunknown>\n"}}

我自己尝试了一个下午实在找不到问题才问的,很不好意思打扰了。

0

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api

这样一看不知道代理服务是否暴露 9515 端口出来,方便的话你可以贴完全部 docker 命令,敏感信息去掉,然后把日志也贴一下

另外服务器运行是直接成功的ssh返回的containid,并没有什么日志 所以贴不出来啊...

3

@linweiyuan 可以不用代理吗?我看readMe里面提供了默认的代理,但是实际上我的项目还是没法跑起来,go-chatgpt-api日志是红色的一个HTML image 然后,chatgpt-proxy-server是

Starting ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) on port 9515
All remote connections are allowed. Use an allowlist instead!
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1680530073.681][SEVERE]: Timed out receiving message from renderer: 300.000
[1680530073.684][SEVERE]: Timed out receiving message from renderer: -0.003
[1680530073.693][SEVERE]: Timed out receiving message from renderer: -0.003

然后chatgpt-web的日志:

TypeError: fetch failed
    at Object.fetch (node:internal/deps/undici/undici:11413:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async fetchSSE (file:///app/node_modules/.pnpm/chatgpt@5.2.2/node_modules/chatgpt/build/index.js:46:15) {
  cause: Error: connect ECONNREFUSED 172.22.0.3:8080
      at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1494:16) {
    errno: -111,
    code: 'ECONNREFUSED',
    syscall: 'connect',
    address: '172.22.0.3',
    port: 8080
  }
}
POST http://go-chatgpt-api:8080/conversation {
  body: {
    action: 'next',
    messages: [ [Object] ],
    model: 'text-davinci-002-render-sha',
    parent_message_id: 'bd29c712-1cf4-491a-990f-81a803173d62'
  },
1

@starsliao 有图形界面就好办,下个 Chrome,然后下那个 undetected_chromedriver 本地跑起来,接着进 API 代码里注释掉 headless 模式,就可以很方便利用浏览器调试,看下这个验证码该如何处理

@linweiyuan 我现在直接在服务器上部署的了,没有走代理的方式,没有问题了,没有出现验证码的报错了。

1

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api

这样一看不知道代理服务是否暴露 9515 端口出来,方便的话你可以贴完全部 docker 命令,敏感信息去掉,然后把日志也贴一下

你好,弄到现在测试一下好像又可以了。。。就是因为restart: unless-stopped

这是原来的

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515/ linweiyuan/go-chatgpt-api

这是加了重启

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515/ --restart unless-stopped linweiyuan/go-chatgpt-api

加了重启就可以了。可是问题是我下午加了重启只是状态正常端口没有出来,但是现在端口又出来了。代码完全一样,我还以为是玄学测试好几次发现现在就是可以,我都不晓得为啥下午不行了。现在就是 restart: unless-stopped加了就可以了。。。

0

@ly1102 不知道你的配置具体改了什么,如果你用我最上面开始的那个配置,单纯修改 accessToken,可以跑起来吗?

如果你有合适的微信群,发图片到我邮箱(邮箱在代码提交日志有),然后我进群看看能否解决,不会有任何形式的收费

5

你好 我不太喜欢用文件 就用下面的方式映射端口出来 但是go项目一直启动失败也没有报错 你知道怎么回事吗?

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515 linweiyuan/go-chatgpt-api

这样一看不知道代理服务是否暴露 9515 端口出来,方便的话你可以贴完全部 docker 命令,敏感信息去掉,然后把日志也贴一下

你好,弄到现在测试一下好像又可以了。。。就是因为restart: unless-stopped

这是原来的

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515/ linweiyuan/go-chatgpt-api

这是加了重启

docker run --name gptapi -d -p 127.0.0.1:3001:8080 --env GIN_MODE=release --env CHATGPT_PROXY_SERVER=http://172.17.0.1:9515/ --restart unless-stopped linweiyuan/go-chatgpt-api

加了重启就可以了。可是问题是我下午加了重启只是状态正常端口没有出来,但是现在端口又出来了。代码完全一样,我还以为是玄学测试好几次发现现在就是可以,我都不晓得为啥下午不行了。现在就是 restart: unless-stopped加了就可以了。。。

又不行了,一瞬间就取消端口, 最后排查出来确实是端口映射问题 没有开放出来 已解决 感谢

1

@superen7527 我本意是去掉 token 敏感信息

照你说的加了 restart 配置就可以,有理由相信是你没控制好启动顺序,api 起来后 proxy 还没起来,挂了

1

@superen7527 我本意是去掉 token 敏感信息

照你说的加了 restart 配置就可以,有理由相信是你没控制好启动顺序,api 起来后 proxy 还没起来,挂了

嗯 我一开始也是这么认为的 ,所以先启动的 等了好久才go。应该是我习惯不多ip占用端口,映射到localhost了。但是172访问不了localhost所以造成一下午排查还没出来问题在哪。因为curl正常倒是没有考虑主程序run错了。

另外想问问能不能整合到一个docker里面?不然感觉要跑两个 怪怪的。比如独立一个go里面 有 chatgpt-proxy-server和go的api 只需要开放出来一个8080不需要9515或者组网了。

9

@superen7527 我本意是去掉 token 敏感信息 照你说的加了 restart 配置就可以,有理由相信是你没控制好启动顺序,api 起来后 proxy 还没起来,挂了

嗯 我一开始也是这么认为的 ,所以先启动的 等了好久才go。应该是我习惯不多ip占用端口,映射到localhost了。但是172访问不了localhost所以造成一下午排查还没出来问题在哪。因为curl正常倒是没有考虑主程序run错了。

另外想问问能不能整合到一个docker里面?不然感觉要跑两个 怪怪的。比如独立一个go里面 有 chatgpt-proxy-server和go的api 只需要开放出来一个8080不需要9515或者组网了。

因为这个 proxy-server 理论上是万年不动的,而除了 Go 程序,我还有一个 Java 的,两个都用 GitHub Actions 自动打包,所以不好整合

7

摸索出来的,用了一段时间,目前还可以用,能过 Cloudflare 403:linweiyuan/chatgpt-proxy-server

可以用现成的镜像,也可以自己打包,有 Java 和 Go 实现的 API,开源

除了官方 429,没有速率限制,但可能会不稳定,可能会突然失效(失效会尝试更新)

适合自建自用的场景(多人用会有各种问题)

结合本项目,可以这样使用

version: '3'

services:
  app:
    image: chenzhaoyu94/chatgpt-web # 总是使用 latest ,更新时重新 pull 该 tag 镜像即可
    ports:
      - 127.0.0.1:3002:3002
    environment:
      # 二选一
      OPENAI_API_KEY:
      # 二选一
      OPENAI_ACCESS_TOKEN: eyJxxx
      # API接口地址,可选,设置 OPENAI_API_KEY 时可用
      OPENAI_API_BASE_URL:
      # API模型,可选,设置 OPENAI_API_KEY 时可用,https://platform.openai.com/docs/models
      # gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, code-davinci-002
      OPENAI_API_MODEL:
      # 反向代理,可选
      API_REVERSE_PROXY: http://go-chatgpt-api:8080/conversation
      # 访问权限密钥,可选
      AUTH_SECRET_KEY:
      # 每小时最大请求次数,可选,默认无限
      MAX_REQUEST_PER_HOUR: 0
      # 超时,单位毫秒,可选
      TIMEOUT_MS: 60000
      # Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
      SOCKS_PROXY_HOST:
      # Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
      SOCKS_PROXY_PORT:
      # HTTPS 代理,可选,支持 http,https,socks5
      HTTPS_PROXY:
    depends_on:
      - go-chatgpt-api

  go-chatgpt-api:
    container_name: go-chatgpt-api
    image: linweiyuan/go-chatgpt-api
    environment:
      - GIN_MODE=release
      - CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515
#      - NETWORK_PROXY_SERVER=http://host:port
#      - NETWORK_PROXY_SERVER=socks5://host:port
    depends_on:
      - chatgpt-proxy-server
    restart: unless-stopped

  chatgpt-proxy-server:
    container_name: chatgpt-proxy-server
    image: linweiyuan/chatgpt-proxy-server
    restart: unless-stopped

终端 docker-compose up -d

Starting ChromeDriver 111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}) on port 9515 All remote connections are allowed. Use an allowlist instead! Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe. ChromeDriver was started successfully. 2023/04/03 16:54:54 Failed to create WebDriver: unknown error: unknown error: Chrome failed to start: crashed. (unknown error: DevToolsActivePort file doesn't exist) (The process started from chrome location /opt/google/chrome/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.) (Driver info: chromedriver=111.0.5563.64 (c710e93d5b63b7095afe8c2c17df34408078439d-refs/branch-heads/5563@{#995}),platform=Linux 5.15.49-linuxkit x86_64) 跑起来报错了,请问是什么原因,该怎么解决?

5

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

8

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

可是这是我刚跑起来就崩溃了,还都没能用起来,稳定崩溃

4

@Timoshao 看报的错说参数少了个括号,这个有点难调试,你是自己用还是多人共用

多人用的

9

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

可是这是我刚跑起来就崩溃了,还都没能用起来,稳定崩溃

用现成的镜像还是自己打的,怎么启动的,网络是否正确

6

@Timoshao 看报的错说参数少了个括号,这个有点难调试,你是自己用还是多人共用

多人用的

在最上面一开始就说了,适合自建自用,多人会有各种问题,不好搞

2

在群晖里面跑起来了,没什么问题,前提是要看明白启动顺序,还有自己的国际网络要靠谱

2

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

可是这是我刚跑起来就崩溃了,还都没能用起来,稳定崩溃

用现成的镜像还是自己打的,怎么启动的,网络是否正确

我把你两个Dockerfile和在一起运行了,网络应该是正常的 https://github.com/dvc890/go-chatgpt-api/blob/main/Dockerfile

4

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

可是这是我刚跑起来就崩溃了,还都没能用起来,稳定崩溃

用现成的镜像还是自己打的,怎么启动的,网络是否正确

我把你两个Dockerfile和在一起运行了,网络应该是正常的 https://github.com/dvc890/go-chatgpt-api/blob/main/Dockerfile

var err error
WebDriver, err = selenium.NewRemote(selenium.Capabilities{
    "chromeOptions": chrome.Capabilities{
        Args:            chromeArgs,
        ExcludeSwitches: []string{"enable-automation"},
    },
}, chatgptProxyServer)

因为 :=,这个 WebDriver 变成了类似局部变量

7

@dvc890 由于这种方式不是百分百稳定,这种情况可以重启服务试下,先 down 再 up,不能 restart

可是这是我刚跑起来就崩溃了,还都没能用起来,稳定崩溃

用现成的镜像还是自己打的,怎么启动的,网络是否正确

我把你两个Dockerfile和在一起运行了,网络应该是正常的 https://github.com/dvc890/go-chatgpt-api/blob/main/Dockerfile

var err error
WebDriver, err = selenium.NewRemote(selenium.Capabilities{
  "chromeOptions": chrome.Capabilities{
      Args:            chromeArgs,
      ExcludeSwitches: []string{"enable-automation"},
  },
}, chatgptProxyServer)

因为 :=,这个 WebDriver 变成了类似局部变量

谢谢大佬,不过出现了上面哥们同样的问题:

INFO[2233] Checking captcha
ERRO[2248] Failed to handle captcha: timeout after 15.215620036s
ERRO[2248] 
ERRO[2248] <html><head><script>window['__CF$cv$params']={r:'793e0136a57ef973',m:'D9aoBgw6nXhTwDNsh1zUqiBvkHfsE.xvwl9aKYVnX4w-1675457068-0-AQDZ6VQlzLEk7EqLco1GkT5ydLmrle2ABYqrehe3o61K/10yAkzQLgFUQQUpnH57r16DzfjFt59EoEUqVRHOB5Ml6eut8CvvkaSwi0+5Kk1+TZrh+dOyMhFp5lHSRhbu9HF75amCEs1hwX4T22w+CsU=',s:[0x2ccf6e6f29,0xddf5dd5974],u:'/cdn-cgi/challenge-platform/h/b'};var now=Date.now()/1000,offset=14400,ts=''+(Math.floor(now)-Math.floor(now%offset)),_cpo=document.createElement('script');_cpo.nonce='',_cpo.src='/cdn-cgi/challenge-platform/h/b/scripts/alpha/invisible.js?ts='+ts,document.getElementsByTagName('head')[0].appendChild(_cpo);</script><script src="/cdn-cgi/challenge-platform/h/b/scripts/alpha/invisible.js?ts=1680580800"></script></head><body></body></html>

上面的问题可以怎么解决?

6

@dvc890 这个问题暂时不知道怎么解决,因为我无法复现,你可以本地调试下,看网页怎么显示

如果你是本地跑,然后网络代理配置服务器,不如直接在服务器上面跑

2

我再研究看看,我这个就是在服务器上面跑出现的,本地跑反而没复现……

研究了一下你代码,其实这里是弹了验证码界面了是吧,但是你做的是那种点击验证的方式,验证码的没有做

1

对只做了点击验证,因为只遇到过这个

不知道这个弹了什么,单纯这个报错输出的 js 看不出

2

对只做了点击验证,因为只遇到过这个

不知道这个弹了什么,单纯这个报错输出的 js 看不出

有没有什么办法可以输出更多信息来定位

5

对只做了点击验证,因为只遇到过这个 不知道这个弹了什么,单纯这个报错输出的 js 看不出

有没有什么办法可以输出更多信息来定位

最好就是本地取消 headless 模式调试,打开个浏览器什么都能看

6

对只做了点击验证,因为只遇到过这个 不知道这个弹了什么,单纯这个报错输出的 js 看不出

有没有什么办法可以输出更多信息来定位

最好就是本地取消 headless 模式调试,打开个浏览器什么都能看

哎,今天才接触docker和这种反爬虫技术,本地取消 headless 模式调试都不知道怎么搞,只能慢慢学习了

4

此 issue 先关了,感谢这个项目让我蹭了一波流量

后续有问题大家可以到各自项目下提 issue

2

大佬太牛逼了。大佬谦虚的说 JS 掌握得不是很好。要是和这个项目的大佬一合作,后端+前端。简直是无敌了。

8

挖坟

昨晚找到了一个方法解决多人共用问题,目前不用人手一个了,只需跑一个 go-chatgpt-api,不同的 accessToken 可以同时使用,相同的话则报错 Only one message at a time. Please allow any other responses to complete before sending another message, or wait one minute.

演示视频:多人共用一个代理

8

国内vps,安装了clash,代理能正常爬墙 想自建代理,配置如下version: "3" services: go-chatgpt-api: container_name: go-chatgpt-api image: linweiyuan/go-chatgpt-api ports:

  • 8082:8080 # 宿主机8080端口可按需改为其它端口 environment:
  • GIN_MODE=release
  • CHATGPT_PROXY_SERVER=http://chatgpt-proxy-server:9515
  • NETWORK_PROXY_SERVER=socks5://172.17.0.1:7890 depends_on:
  • chatgpt-proxy-server restart: unless-stopped

    chatgpt-proxy-server: container_name: chatgpt-proxy-server image: linweiyuan/chatgpt-proxy-server restart: unless-stopped 启动一切正常,有显示 go-chatgpt-api | INFO[0008] Welcome to ChatGPT 这样算OK了吧!

然后启动chatgpt-web,配置如下: version: '3'

services: app: image: chenzhaoyu94/chatgpt-web # 总是使用 latest ,更新时重新 pull 该 tag 镜像即可 ports:

  • 0.0.0.0:7679:3002 environment: 二选一 OPENAI_API_KEY: sk-xxx 二选一

    OPENAI_ACCESS_TOKEN: 这里隐去

    API接口地址,可选,设置 OPENAI_API_KEY 时可用 OPENAI_API_BASE_URL: xxx API模型,可选,设置 OPENAI_API_KEY 时可用,https://platform.openai.com/docs/models gpt-4, gpt-4-0314, gpt-4-32k, gpt-4-32k-0314, gpt-3.5-turbo, gpt-3.5-turbo-0301, text-davinci-003, text-davinci-002, code-davinci-002 OPENAI_API_MODEL: xxx 反向代理,可选

    API_REVERSE_PROXY: https://172.17.0.1:8082/conversation #这个ip是docker桥接接口 ,试过lan接口也报一样错

    访问权限密钥,可选

    AUTH_SECRET_KEY: hhxxttxs76

    每小时最大请求次数,可选,默认无限

    MAX_REQUEST_PER_HOUR: 0

    超时,单位毫秒,可选

    TIMEOUT_MS: 60000

    Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效

    SOCKS_PROXY_HOST: xxx

    Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效

    SOCKS_PROXY_PORT: xxx

    HTTPS 代理,可选,支持 http,https,socks5 HTTPS_PROXY: http://xxx:7890

启动正常, Attaching to chatgpt-web_app_1 app_1 | app_1 | > chatgpt-web-service@1.0.0 prod /app app_1 | > node ./build/index.mjs app_1 | app_1 | Server is running on port 3002 app_1 | POST https://172.17.0.1:8082/conversation { app_1 | body: { app_1 | action: 'next', app_1 | messages: [ [Object] ], app_1 | model: 'gpt-3.5-turbo', app_1 | parent_message_id: 'ba31ee36-a8c3-4cec-954e-3b792b6afc34' app_1 | }, app_1 | headers: {

只要打开web界面,报错如下: app_1 | FetchError: request to https://172.17.0.1:8082/conversation failed, reason: Invalid SOCKS proxy details were provided. app_1 | at ClientRequest. (file:///app/node_modules/.pnpm/node-fetch@3.3.0/node_modules/node-fetch/src/index.js:108:11) app_1 | at ClientRequest.emit (node:events:525:35) app_1 | at onerror (/app/node_modules/.pnpm/agent-base@6.0.2/node_modules/agent-base/dist/src/index.js:117:21) app_1 | at callbackError (/app/node_modules/.pnpm/agent-base@6.0.2/node_modules/agent-base/dist/src/index.js:136:17) app_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) { app_1 | type: 'system', app_1 | errno: undefined, app_1 | code: undefined, app_1 | erroredSysCall: undefined app_1 | } @Chanzhaoyu @linweiyuan 请问,是我vps的ip不干净么?还是其他什么原因?大佬指导一二啊!xiexie!

0

后续,有新情况 我把 https://172.17.0.1:8082/conversation 替换为 http://go-chatgpt-api:8082/conversation 不报上面那个错误了, 是另外的错误,一直超时,,没有回复

app_1 | TimeoutError: OpenAI timed out waiting for response app_1 | at file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:70:24 app_1 | at new Promise () app_1 | at pTimeout (file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:48:28) app_1 | at ChatGPTAPI.sendMessage (file:///app/node_modules/.pnpm/chatgpt@5.1.2/node_modules/chatgpt/build/index.js:319:14) app_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) app_1 | at async chatReplyProcess (file:///app/build/index.mjs:100:22) app_1 | at async file:///app/build/index.mjs:237:5 app_1 | TimeoutError: OpenAI timed out waiting for response app_1 | at file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:70:24 app_1 | at new Promise () app_1 | at pTimeout (file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:48:28) app_1 | at ChatGPTAPI.sendMessage (file:///app/node_modules/.pnpm/chatgpt@5.1.2/node_modules/chatgpt/build/index.js:319:14) app_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) app_1 | at async chatReplyProcess (file:///app/build/index.mjs:100:22) app_1 | at async file:///app/build/index.mjs:237:5

0

早上不是好了吗?

# Socks代理,可选,和 SOCKS_PROXY_PORT 一起时生效
SOCKS_PROXY_HOST: xxx
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
SOCKS_PROXY_PORT: xxx

这两个参数注释掉,然后改回去 172.17.0.1

1

改回去172.17.0.1试了,也是OK的,不报那个无效代理了。是我粗心了,忘记注释掉那两个选项。 看来,现在就是超时的问题了。

不知道咋整了

app_1 | app_1 | > chatgpt-web-service@1.0.0 prod /app app_1 | > node ./build/index.mjs app_1 | app_1 | Server is running on port 3002 app_1 | sendMessage (34 tokens) { app_1 | max_tokens: 1000, app_1 | model: 'gpt-3.5-turbo', app_1 | temperature: 0.8, app_1 | top_p: 1, app_1 | presence_penalty: 1, app_1 | messages: [ app_1 | { app_1 | role: 'system', app_1 | content: "You are ChatGPT, a large language model trained by OpenAI. Follow the user's instructions carefully. Respond using markdown." app_1 | }, app_1 | { role: 'user', content: '是的发生', name: undefined } app_1 | ], app_1 | stream: true app_1 | } app_1 | TimeoutError: OpenAI timed out waiting for response app_1 | at file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:70:24 app_1 | at new Promise () app_1 | at pTimeout (file:///app/node_modules/.pnpm/p-timeout@6.1.1/node_modules/p-timeout/index.js:48:28) app_1 | at ChatGPTAPI.sendMessage (file:///app/node_modules/.pnpm/chatgpt@5.1.2/node_modules/chatgpt/build/index.js:319:14) app_1 | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) app_1 | at async chatReplyProcess (file:///app/build/index.mjs:100:22) app_1 | at async file:///app/build/index.mjs:237:5 一直就这样。。。。。

7

image