Comments (25)
Same problem, Macos + Docker, Set api to localhost works fine, but it won't work if set to my own server ip, but I can access the api service well via python script.
from chatgpt-next-web.
kind reminder, ur api domain exposed in ur first image
from chatgpt-next-web.
Bot detected the issue body's language is not English, translate it automatically.
Title: http custom API only supports localhost, and cannot be accessed using non-native IP or url [Bug]
from chatgpt-next-web.
from you screenshot it seems to the cors issue with your openai api provider?
from chatgpt-next-web.
from you screenshot it seems to the cors issue with your openai api provider?
but if i forward the api provider ip&port to local, then the nextweb works well, it's very strange. By the way, the api provider is deployed in a server on the same subnet, and i currently use vscode for prot forwarding.😂
from chatgpt-next-web.
sorry, close the issue by accident.
from chatgpt-next-web.
from you screenshot it seems to the cors issue with your openai api provider?
Besides, I can access the API service well via curl command:
curl --location 'http://ip:port/v1/chat/completions' \
--header 'Content-Type: application/json' \
--header 'Authorization: xxxxx' \
--data '{
"model": "gpt-4",
"messages": [ {"role": "user", "content": "hello"}]
}'
the api service also works with a congeneric app ChatX, but in NextChat, it still not work.
from chatgpt-next-web.
I have used Burp Suite to capture http package, and the result demonstrate that when using a API deployed in localhost, the request packages are sent correctly:
OPTIONS /v1/chat/completions HTTP/1.1
Host: localhost:1999
Accept: */*
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type,x-requested-with
Origin: https://app.nextchat.dev
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.160 Safari/537.36
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: close
POST /v1/chat/completions HTTP/1.1
Host: localhost:1999
Content-Length: 773
sec-ch-ua: "Chromium";v="121", "Not A(Brand";v="99"
Accept: application/json, text/event-stream
Content-Type: application/json
x-requested-with: XMLHttpRequest
sec-ch-ua-mobile: ?0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.6167.160 Safari/537.36
sec-ch-ua-platform: "macOS"
Origin: https://app.nextchat.dev
Sec-Fetch-Site: cross-site
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty
Accept-Encoding: gzip, deflate, br
Accept-Language: en-US,en;q=0.9
Connection: close
{"messages":[{"role":"system","content":"\nYou are ChatGPT, a large language model trained by OpenAI.\nKnowledge cutoff: 2021-09\nCurrent model: gpt-4\nCurrent time: 2/22/2024, 9:31:13 AM\nLatex inline: $x^2$ \nLatex block: $$e=mc^2$$\n\n"},{"role":"user","content":"hello"},{"role":"assistant","content":"Hello! How can I assist you today?"},{"role":"user","content":"0.0.0.0 是监听本机所有 ip 吗"},{"role":"assistant","content":"\n\nUnauthorized access, please enter access code in [auth](/#/auth) page, or enter your OpenAI API Key.\n\n```json\n{\n \"error\": \"Unauthorized\"\n}\n```"},{"role":"user","content":"docker -e 可以添加多个环境变量吗"}],"stream":true,"model":"gpt-4","temperature":0.5,"presence_penalty":0,"frequency_penalty":0,"top_p":1}
And if I set the endpoint API to another subnet host (Like http://222.21.136.207:1999), then no http package is captured, and the NextChat just raise an error:
However, if I set the API to localhost back, then capture and redirect the http package to the subnet host. In this way, NextChat can receive the response package from the subnet host and works correctly, which can not achieved by directly set the subnet host API as the endpoint API in the configuration.
from chatgpt-next-web.
你是不是使用了 NAT 进行了端口映射,这可能会有 NAT 环回的问题。
from chatgpt-next-web.
Bot detected the issue body's language is not English, translate it automatically.
Have you used NAT for port mapping? This may cause NAT loopback problems.
from chatgpt-next-web.
你是不是使用了 NAT 进行了端口映射,这可能会有 NAT 环回的问题。
我应该没有主动配置 NAT 端口映射,而且 NAT 环回会导致 NextChat这类 app不能 send url request 吗?主要用 curl又是好的,就很奇怪。
from chatgpt-next-web.
Bot detected the issue body's language is not English, translate it automatically.
Have you used NAT for port mapping? This may cause NAT loopback problems.
I should not have actively configured NAT port mapping, and will NAT loopback prevent apps like NextChat from sending url requests? Mainly using curl is fine, but it's strange.
from chatgpt-next-web.
Same problem, Macos + Docker, Set api to localhost works fine, but it won't work if set to my own server ip, but I can access the api service well via python script.
Supplement: If using windows nextchat client, it work fine if set to my own server ip
from chatgpt-next-web.
Same problem, Macos + Docker, Set api to localhost works fine, but it won't work if set to my own server ip, but I can access the api service well via python script.
Supplement: If using windows nextchat client, it work fine if set to my own server ip
Very useful information, i'm a mac user too, and the nextchat web also didn't work on ios device. i will test it on windows later.
from chatgpt-next-web.
Same problem.
I hosted a OpenAI-Like API on server and it works fine with curl(on macos)/Next-Web(on windows client),but raised a error using Next-Web(on macos client)
curl(on macos):
Next-Web(on windows client):
Just works fine.
Next-Web(on macos client):
from chatgpt-next-web.
@fred-bf I believe the bug tag should be added back, since another issue #2810 reveals this bug too. This bug seems to exist for a period.
from chatgpt-next-web.
I don't have any issues with this; it has been running on Kubernetes (k8s) without problems
from chatgpt-next-web.
I don't have any issues with this; it has been running on Kubernetes (k8s) without problems
Are you using an Mac client? It seems that the issue only exist on Mac.
from chatgpt-next-web.
I don't have any issues with this; it has been running on Kubernetes (k8s) without problems
Are you using an Mac client? It seems that the issue only exist on Mac.
right now I am using windows client and using port-forward pods k8s
from chatgpt-next-web.
I just tried build a development macOS client, it could make request to custom ip. But when switching to a online version, I could reproduce this issue. It might be released to tauri production build configuration?
from chatgpt-next-web.
I just tried build a development macOS client, it could make request to custom ip. But when switching to a online version, I could reproduce this issue. It might be released to tauri production build configuration?
no,the problem its not only desktop
from chatgpt-next-web.
I just tried build a development macOS client, it could make request to custom ip. But when switching to a online version, I could reproduce this issue. It might be released to tauri production build configuration?
Supplement: the same problem also occurs on the online web version (app.nextchat.dev) and the self-deployed vercel version. Hope this info help.
from chatgpt-next-web.
@wjfu99 For web version, plz check whether its blocked by mixed https content
from chatgpt-next-web.
@fred-bf Hi, you are absolutely right! i check the console log, and find the mixed content error:
So, this issue on web version can be solved by allowing the insecure content in website permission:
By the way, do you have any ideas on how to solve this problem in the local client version?🤣
@wjfu99 For web version, plz check whether its blocked by mixed https content
from chatgpt-next-web.
close for now, please feel free to report if you encounter any additional issue
from chatgpt-next-web.
Related Issues (20)
- [Feature Request]: 能否支持语音输入功能 HOT 7
- [Bug] Chinese contents with **bold marks** are not correctly rendered HOT 7
- [Bug] 回复中的公式不能正常显示 HOT 2
- app.nextchat.dev 不能设置 API Key了吗? HOT 7
- [Feature Request]: 图标问题 HOT 4
- [Bug] Bold text mark appears in the chat title when using `gemini-pro` model HOT 2
- [Bug] it seems that `max_token`s not be sent as a request param HOT 2
- [Feature Request]: Docker部署的如何开启ssl HOT 2
- 不合法的 OpenAI 响应 HOT 3
- [Bug] Issue with NextWeb API Key Deactivation Error HOT 4
- [Bug] 访问密码不正确或为空 HOT 3
- The response content of gpt4-vision model is too short [Bug] HOT 5
- [Bug] Mac OS版本不支持中文输入 HOT 2
- [Bug] Azure gpt4的api传过来的数据为什么是2021年的 HOT 8
- [Feature Request]: 能支持gpt-4-turbo-preview模型吗 HOT 4
- [Bug] gpt-4-vision-preview模型回答中断 HOT 7
- [Feature Request]: 希望支持http和不安全的https HOT 1
- [Bug] HOT 11
- [Bug] 桌面版本更新2.10.3+后历史记录全部消失 HOT 9
- 接口地址url两侧的空白字符不会自动去掉 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chatgpt-next-web.