-
Notifications
You must be signed in to change notification settings - Fork 60.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在 MacOS 上,http自定义 API 仅支持 localhost,使用非本机 ip 或 url 均无法访问[Bug] #4095
Comments
Title: http custom API only supports localhost, and cannot be accessed using non-native IP or url [Bug] |
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.😂 |
sorry, close the issue by accident. |
Besides, I can access the API service well via curl command:
the api service also works with a congeneric app ChatX, but in NextChat, it still not work. |
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:
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. |
你是不是使用了 NAT 进行了端口映射,这可能会有 NAT 环回的问题。 |
Have you used NAT for port mapping? This may cause NAT loopback problems. |
我应该没有主动配置 NAT 端口映射,而且 NAT 环回会导致 NextChat这类 app不能 send url request 吗?主要用 curl又是好的,就很奇怪。 |
|
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. |
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 |
kind reminder, ur api domain exposed in ur first image |
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. |
@wjfu99 For web version, plz check whether its blocked by mixed https content |
@fred-bf Hi, you are absolutely right! i check the console log, and find the mixed content error:
|
close for now, please feel free to report if you encounter any additional issue |
how can i do, how to fix
|
@hhhaiai you can solve this by allowing the insecure content in website permission (chrome and edge should both support that): refer to this reply |
为什么要发送OPTIONS给API?直接发POST不行么 |
Why send OPTIONS to API? Can't you just send a POST directly? |
Bug Description
自定义接口使用本地部署的 API可以正常使用,使用非本机部署的API 显示 failed to load 或 failed to fetch。部署的 API 应该没有问题,在本机通过端口转发将外部 ip 对应端口映射至本地也可正常使用。
Steps to Reproduce
1.使用本地部署 api:
2.使用非本机部署 api:
Expected Behavior
使用 http+外部 ip 的 API 也可以正常使用。
Screenshots
No response
Deployment Method
Desktop OS
Macos
Desktop Browser
No response
Desktop Browser Version
No response
Smartphone Device
No response
Smartphone OS
No response
Smartphone Browser
No response
Smartphone Browser Version
No response
Additional Logs
No response
The text was updated successfully, but these errors were encountered: