Giter Site home page Giter Site logo

Comments (10)

roodkcab avatar roodkcab commented on May 23, 2024 4

me too. and I added code below to output result already returned

        ws.on('close', () => {
          console.warn('WebSocket close')
          if (!isFulfilled) {
            isFulfilled = true
            resolve(result)
            return
          }
        })

I'm thinking it's may better to handle reconnect, since there's a message which type is 7 that allowReconnect, need to find out how bing handle this message on socket close

from bing-chat.

roodkcab avatar roodkcab commented on May 23, 2024 1

@IceCream0910 sorry, account being banned. maybe u can try to send {"type":6} every 15 seconds to keep connection alive.

from bing-chat.

transitive-bullshit avatar transitive-bullshit commented on May 23, 2024

@semse I'm currently not able to test / reproduce since the shared Microsoft account a bunch of us were using got disabled.

from bing-chat.

anhiao avatar anhiao commented on May 23, 2024

me too. and I added code below to output result already returned

        ws.on('close', () => {
          console.warn('WebSocket close')
          if (!isFulfilled) {
            isFulfilled = true
            resolve(result)
            return
          }
        })

I'm thinking it's may better to handle reconnect, since there's a message which type is 7 that allowReconnect, need to find out how bing handle this message on socket close

Thanks for your help, it is currently useful to solve the sometimes await unresponsive content

from bing-chat.

alexandrius avatar alexandrius commented on May 23, 2024

I noticed that {"type":6} is sent every 15 seconds or so. Maybe that's what keeps it alive. Can't test no more. I think I was banned.

from bing-chat.

IceCream0910 avatar IceCream0910 commented on May 23, 2024

@roodkcab

I'm thinking it's may better to handle reconnect, since there's a message which type is 7 that allowReconnect, need to find out how bing handle this message on socket close

Did you find a solution? As you said, when the "{"type":7}" message, the socket connection is closed. Why does it disconnect even though no cleanup() was executed... I can't find a way to reconnect with my abilities.

from bing-chat.

IceCream0910 avatar IceCream0910 commented on May 23, 2024

@IceCream0910 sorry, account being banned. maybe u can try to send {"type":6} every 15 seconds to keep connection alive.

Thanks, I sent type 6 messages and it works without stopping.

from bing-chat.

binikingi avatar binikingi commented on May 23, 2024

@IceCream0910 Can you share the code?

from bing-chat.

IceCream0910 avatar IceCream0910 commented on May 23, 2024

@IceCream0910 Can you share the code?
@binikingi

I'm not sure that my code is best solution, but I sends a type:6 request to websocket's 'on' event function. And when websocket is closed, stop interval using clearInterval.

ws.on("open", () => { 
           ws.send(`{"protocol":"json","version":1}${terminalChar}`); 
           reconnectInterval = setInterval(() => { 
             ws.send(`{"type":6}${terminalChar}`); 
           }, 10 * 1000); 
         });

...

from bing-chat.

binikingi avatar binikingi commented on May 23, 2024

@IceCream0910 yup this works for me. thanks

from bing-chat.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.