bingAI always uses magicUrl for wss://

This commit is contained in:
James Feng Cao 2023-05-24 22:58:18 +08:00
parent a1f7adb7f0
commit f536c6eb78

View file

@ -166,10 +166,10 @@ class Chat {
//(string,function:可以不传) //(string,function:可以不传)
sendMessage(message, onMessage) { sendMessage(message, onMessage) {
try { try {
let restsrstUrl = 'wss://sydney.bing.com/sydney/ChatHub'; //let restsrstUrl = 'wss://sydney.bing.com/sydney/ChatHub';
if (this.chatWithMagic==true) { //if (this.chatWithMagic==true)
restsrstUrl = URLTrue(this.magicUrl.replace('http', 'ws'), "ChatHub"); let restsrstUrl = URLTrue(this.magicUrl.replace('http', 'ws'), "sydney/ChatHub");
}
let chatWebSocket = new WebSocket(restsrstUrl); let chatWebSocket = new WebSocket(restsrstUrl);
chatWebSocket.onopen = () => { chatWebSocket.onopen = () => {
this.sendMessageManager.sendShakeHandsJson(chatWebSocket); this.sendMessageManager.sendShakeHandsJson(chatWebSocket);