node-chatgpt-api
node-chatgpt-api copied to clipboard
local Bing correctly, but server does not work
I'm running into some issues, When I deploy locally bing returns correctly, When I deploy on the server but no results are returned, Have you ever encountered this? I guarantee the code is exactly the same
On the server, try doing a curl GET request to https://www.bing.com/turing/conversation/create. You should see Sorry, you are not allowed to access this service if it works, but maybe Bing blocks some IPs from VPS networks entirely.
I tried it and found that my host is cn.bing.com, so can I support the configuration of host?

@yuwangi Can you first turn on debug mode for the Bing client and try it on the server? Let me know what the console shows.
国内ip会强制跳转cn.bing.com不支持bingAI 你可以尝试host能否解决 如果不行就需要翻墙
@waylaidwanderer
I tried it, changing the server code to cn.bing.com is ok.
I originally wanted to try to use nginx reverse proxy directly, but the cookie and authentication information will be discarded, so I hope to support host customization, thks
In setting.js I defined the host: 'https://cn.bing.com',
But it is not work
ReferenceError: host is not defined
at BingAIClient.createNewConversation (file:///var/chatgpt-api/src/BingAIClient.js:19:41)
at BingAIClient.sendMessage (file:///var/chatgpt-api/src/BingAIClient.js:120:62)
at Object.
@eu09 Oops, thanks for catching that. Fixed in 1.17.6.