ChatGPTNextWeb / ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). 一键拥有你自己的跨平台 ChatGPT/Gemini 应用。
https://app.nextchat.dev/
MIT License
75.75k stars 58.88k forks source link

[Bug] WEB采用的是否是使用者本地环境的网络 #3805

Closed liuhrme closed 9 months ago

liuhrme commented 9 months ago

为了提高交流效率,我们设立了官方 QQ 群和 QQ 频道,如果你在使用或者搭建过程中遇到了任何问题,请先第一时间加群或者频道咨询解决,除非是可以稳定复现的 Bug 或者较为有创意的功能建议,否则请不要随意往 Issue 区发送低质无意义帖子。

点击加入官方群聊

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭,如果没有提供下方的信息,我们无法定位你的问题。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

描述问题

环境docker,ChatGPT-Next-Web版本号V2.10.1,使用终端安卓/win11,访问方式WEB,API服务自建。

在1月9日搭建应用后,容器环境网络没有问题,但是自定义openapi无法访问,后来经过反复测试,推断是WEB应用使用的是访问者的网络环境。

举例:API服务访问地址为IPV6,应用网络环境为IPV4,蜂窝网是双栈,访问应用(ipv4)后指定API(ipv6),然后应用可以正常访问;

那么问题就在这里,如果API服务部署在内网,内网自建ChatGPT-Next-Web应用后通过NGINX转发到公网环境,如果要使用,必须将内网的API服务映射到公网环境,才能正常访问。按我个人理解,它应该是使用了客户端侧网络访问,而非服务端网络访问。

如何复现 内网建立open API服务,内网建立服务端指定base_url,在服务端和api能够正常通信时,内网客户端无法使用服务。

内网建立api服务(ipv6网络),公网(ipv4网络)建立服务端,API与服务端无法正常通信,使用者可以访问两侧网络,这种情况就能够正常使用,所以我推测它是使用的用户侧的网络,而不是服务侧的网络。

截图

微信图片_20240110141000 微信图片_20240110141021

微信图片_20240110144600 微信图片_20240110144609

这种情况,在用户侧的网络同时支持IPV6和IPV4,能够正常使用,否则不能使用。

请问这是设计就是如此,还是说我的使用方式不对。

一些必要的信息

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Whether the WEB uses the network of the user's local environment

In order to improve communication efficiency, we have set up an official QQ group and QQ channel. If you encounter any problems during use or construction, please join the group or channel for consultation as soon as possible, unless it is a bug that can be stably reproduced or More creative feature suggestions, otherwise please do not send low-quality and meaningless posts to the Issue area.

Click to join the official group chat

Feedback Instructions

⚠️ NOTE: Any post that does not follow this template will be immediately closed and we will not be able to locate your issue without providing the information below.

Please enter x in the square brackets below to indicate that you already know the relevant content.

Describe the problem

Environment docker, ChatGPT-Next-Web version number V2.10.1, using terminal Android/win11, access method WEB, API service self-built.

After building the application on January 9, there was no problem with the container environment network, but the custom openapi could not be accessed. After repeated testing, it was concluded that the WEB application was using the visitor's network environment.

For example: the API service access address is IPV6, the application network environment is IPV4, and the cellular network is dual-stack. After accessing the application (ipv4), specify the API (ipv6), and then the application can be accessed normally;

Then the problem is here. If the API service is deployed on the intranet, the intranet builds its own ChatGPT-Next-Web application and forwards it to the public network environment through NGINX. If it is to be used, the API service on the intranet must be mapped to the public network environment. for normal access. According to my personal understanding, it should use client-side network access instead of server-side network access.

How ​​to reproduce Establish an open API service on the intranet, and specify the base_url for the server on the intranet. When the server and the API can communicate normally, the intranet client cannot use the service.

The api service is established on the intranet (ipv6 network), and the server is established on the public network (ipv4 network). The API and the server cannot communicate normally. The user can access the networks on both sides. In this case, it can be used normally, so I speculate that it is using The user-side network, not the service-side network.

screenshot

WeChat picture_20240110141000 WeChat picture_20240110141021

WeChat picture_20240110144600 WeChat picture_20240110144609

In this case, the user-side network supports both IPV6 and IPV4 and can be used normally, otherwise it cannot be used.

I would like to ask if this is the design, or if I am using it incorrectly.

Some necessary information

H0llyW00dzZ commented 9 months ago

为了提高交流效率,我们设立了官方 QQ 群和 QQ 频道,如果你在使用或者搭建过程中遇到了任何问题,请先第一时间加群或者频道咨询解决,除非是可以稳定复现的 Bug 或者较为有创意的功能建议,否则请不要随意往 Issue 区发送低质无意义帖子。

点击加入官方群聊

反馈须知

⚠️ 注意:不遵循此模板的任何帖子都会被立即关闭,如果没有提供下方的信息,我们无法定位你的问题。

请在下方中括号内输入 x 来表示你已经知晓相关内容。

  • [x] 我确认已经在 常见问题 中搜索了此次反馈的问题,没有找到解答;
  • [x] 我确认已经在 Issues 列表(包括已经 Close 的)中搜索了此次反馈的问题,没有找到解答。
  • [x] 我确认已经在 Vercel 使用教程 中搜索了此次反馈的问题,没有找到解答。
      **感谢各位开发者的辛勤付出,我发现了一些小问题,是否可以帮忙解答一下。**

描述问题

环境docker,ChatGPT-Next-Web版本号V2.10.1,使用终端安卓/win11,访问方式WEB,API服务自建。

在1月9日搭建应用后,容器环境网络没有问题,但是自定义openapi无法访问,后来经过反复测试,推断是WEB应用使用的是访问者的网络环境。

举例:API服务访问地址为IPV6,应用网络环境为IPV4,蜂窝网是双栈,访问应用(ipv4)后指定API(ipv6),然后应用可以正常访问;

那么问题就在这里,如果API服务部署在内网,内网自建ChatGPT-Next-Web应用后通过NGINX转发到公网环境,如果要使用,必须将内网的API服务映射到公网环境,才能正常访问。按我个人理解,它应该是使用了客户端侧网络访问,而非服务端网络访问。

如何复现 内网建立open API服务,内网建立服务端指定base_url,在服务端和api能够正常通信时,内网客户端无法使用服务。

内网建立api服务(ipv6网络),公网(ipv4网络)建立服务端,API与服务端无法正常通信,使用者可以访问两侧网络,这种情况就能够正常使用,所以我推测它是使用的用户侧的网络,而不是服务侧的网络。

截图

微信图片_20240110141000 微信图片_20240110141021

微信图片_20240110144600 微信图片_20240110144609

这种情况,在用户侧的网络同时支持IPV6和IPV4,能够正常使用,否则不能使用。

请问这是设计就是如此,还是说我的使用方式不对。

一些必要的信息

  • 系统:[windows 10/ android ]
  • 浏览器: [chrome]
  • 版本: [V2.10.1]
  • 部署方式:[docker]

I don't think so it's possible in front-end you have to set it as localhost instead of ipv6

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


In order to improve communication efficiency, we have set up an official QQ group and QQ channel. If you encounter any problems during use or construction, please join the group or channel for consultation as soon as possible, unless it is a bug that can be stably reproduced. Or more creative feature suggestions, otherwise please do not send low-quality and meaningless posts to the Issue area.

Click to join the official group chat

Feedback Instructions

⚠️ NOTE: Any post that does not follow this template will be immediately closed and we will not be able to locate your issue without providing the information below.

Please enter x in the square brackets below to indicate that you already know the relevant content.

  • [x] I confirm that I have searched for the feedback issue in FAQ , no solution found;
  • [x] I confirm that I have searched for this feedback issue in the Issues list (including those that have been Closed), but no answer has been found. .
  • [x] I confirm that I have searched for this feedback in Vercel usage tutorial Question, no answer found.
    **Thank you all developers for your hard work. I have found some minor problems. Can you help me answer them? **

Describe the problem

Environment docker, ChatGPT-Next-Web version number V2.10.1, using terminal Android/win11, access method WEB, API service self-built.

After building the application on January 9, there was no problem with the container environment network, but the custom openapi could not be accessed. After repeated testing, it was concluded that the WEB application was using the visitor's network environment.

Example: The API service access address is IPV6, the application network environment is IPV4, and the cellular network is dual-stack. After accessing the application (ipv4), specify the API (ipv6), and then the application can be accessed normally;

Then the problem is here. If the API service is deployed on the intranet, the intranet builds the ChatGPT-Next-Web application and forwards it to the public network environment through NGINX. If it is to be used, the API service on the intranet must be mapped to the public network environment. , for normal access. According to my personal understanding, it should use client-side network access instead of server-side network access.

How ​​to reproduce Establish an open API service on the intranet, and specify base_url for the server on the intranet. When the server and the API can communicate normally, the intranet client cannot use the service.

Establish an api service on the intranet (ipv6 network), and establish a server on the public network (ipv4 network). The API and the server cannot communicate normally. The user can access the networks on both sides. In this case, it can be used normally, so I speculate that it is Use the user-side network, not the server-side network.

Screenshot

![WeChat picture_20240110141000](https://private-user-images.githubusercontent.com/102905159/295466441-290557a8-3f7d-487b-a994-74b2b140c36b.png?jwt=eyJhbGciOiJIUzI1NiIsInR 5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQ4NzE4ODMsIm5iZiI6MTcwNDg3M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MzFjZmNmYmVlMzkxOGZkNGVjNmEyNjcwZmQ3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rv cl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.oTJuehwzPYrsNjzNCm_mfg0QyOJXJKWOBspmiPZbcNs)

![WeChat picture_20240110144600](https://private-user-images.githubusercontent.com/102905159/295474362-f67eb414-ab41-4294-8f77-d7921476eb9b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI 6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MDQ4NzE4ODMsIm5iZiI6MTcwNDg3MTU4MywicGF0aCI6 Ii8xMDI5MDUxNTkvMjk1NDc0MzYyLWY2N2ViNDE0LWFiNDEtNDI5NC04Zjc3LWQ3OTIxNDc2ZWI5Yi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhb D1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDExMFQwNzI2MjNaJlgtQW16LUV4cGlyZXM9MzAw JlgtQW16LVNpZ25hdHVyZT1hN2JjMGMwOTMyMjFmNjVkMTJjZGIyYzQ1ZjFlMTNkOTE0ZDJjNmZiNTZjMGZjNWYwNzFiOWRmZDQ2N2RjNWY3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZ hY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.X446WzqEszIC_qq1CSjws_QTKIWHnKNdnGF3SAe7DDo) ![ WeChat picture_20240110144609](https://private-user-images.githubusercontent.com/102905159/295474367-d617c30b-1f3d-4dc6-8dd8-caf3b6e9ae39.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6Ik pXVCJ9.eyJpc3 MiOiJna xMDI5MDUxNTkvMjk1NDc0MzY3LWQ2MTdjMzBiLTFmM2QtNGRjNi04ZGQ4LWNhZjNiNmU5YWUzOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD 1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwMTEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDExMFQwNzI2MjNaJlgtQW16LUV4cGlyZXM9MzAwJ lgtQW16LVNpZ25hdHVyZT04NTNkYTI5ZWFlZmQzOGMwNWYxYmQ4YWFjYWVmODg2YmI1OTEwODlkOTNmZGQ4NDc3YmQ5OWRkMzBmMTcxNWJkJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY 3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.HE0Zk1MqJ01YLYL8blnj8wNoreyAzETXfAvo00CsD-s)

In this case, the network on the user side supports both IPV6 and IPV4 and can be used normally, otherwise it cannot be used.

I would like to ask if this is the design, or if I am using it incorrectly.

Some necessary information

  • System: [windows 10/ android]
  • Browser: [chrome]
  • Version: [V2.10.1]
  • Deployment method: [docker]

I don't think so it's possible in front-end you have to set it as localhost instead of ipv6

H0llyW00dzZ commented 9 months ago

alternative to fix use this ngrok for routing

https://ngrok.com/

Yidadaa commented 9 months ago

请在部署的时候使用 BASE_URL 指定你内网的 one-api 地址,不要在前端设置界面更改选项,请清空前端设置页面的接口地址或将其设置为 /api/openai/,这样就会使用你服务侧的地址发送请求。

Issues-translate-bot commented 9 months ago

Bot detected the issue body's language is not English, translate it automatically.


Please use BASE_URL to specify the one-api address of your intranet when deploying. Do not change options in the front-end settings interface. Please clear the interface address of the front-end settings page or set it to /api/openai/, so that it will be used Send the request to the address on your service side.