Git Product home page Git Product logo

Comments (18)

Spxc avatar Spxc commented on June 2, 2024 1

@ShreshthTiwari @debotos Did any of you figure out on how to solve this?
Works fine on localhost, but not prod.

I get the following error:

WebSocket error: Error: Unexpected server response: 200
0|ai-chat  |     at ClientRequest.<anonymous> (/root/AI-chat/node_modules/ws/lib/websocket.js:888:7)
0|ai-chat  |     at ClientRequest.emit (node:events:514:28)
0|ai-chat  |     at HTTPParser.parserOnIncomingClient (node:_http_client:700:27)
0|ai-chat  |     at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
0|ai-chat  |     at TLSSocket.socketOnData (node:_http_client:541:22)
0|ai-chat  |     at TLSSocket.emit (node:events:514:28)
0|ai-chat  |     at addChunk (node:internal/streams/readable:324:12)
0|ai-chat  |     at readableAddChunk (node:internal/streams/readable:297:9)
0|ai-chat  |     at Readable.push (node:internal/streams/readable:234:10)
0|ai-chat  |     at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
0|ai-chat  | file:///root/AI-chat/node_modules/bing-chat/build/index.js:83
0|ai-chat  |             reject(new Error(`WebSocket error: ${error.toString()}`));
0|ai-chat  |                    ^
0|ai-chat  | Error: WebSocket error: Error: Unexpected server response: 200
0|ai-chat  |     at WebSocket.<anonymous> (file:///root/AI-chat/node_modules/bing-chat/build/index.js:83:20)
0|ai-chat  |     at WebSocket.emit (node:events:514:28)
0|ai-chat  |     at emitErrorAndClose (/root/AI-chat/node_modules/ws/lib/websocket.js:1008:13)
0|ai-chat  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
0|ai-chat  | Node.js v18.17.0
0|ai-chat  | Error: socket hang up
0|ai-chat  |     at connResetException (node:internal/errors:720:14)
0|ai-chat  |     at Socket.socketOnEnd (node:_http_client:525:23)
0|ai-chat  |     at Socket.emit (node:events:526:35)
0|ai-chat  |     at endReadableNT (node:internal/streams/readable:1359:12)
0|ai-chat  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
0|ai-chat  |   code: 'ECONNRESET'
0|ai-chat  | }

from bing-chat.

ShreshthTiwari avatar ShreshthTiwari commented on June 2, 2024

It is working perfectly fine on my PC but when i try to run it on my ubuntu server, it shows this error.

from bing-chat.

debotos avatar debotos commented on June 2, 2024

Same for me. Deployed in Heroku. Got the same error.

from bing-chat.

evankozliner avatar evankozliner commented on June 2, 2024

Same error on my end from my mac :(

from bing-chat.

evankozliner avatar evankozliner commented on June 2, 2024
image sydney.bing.com, the url the app reaches out to, does say it is having problems

weird thing is bing chat still seems to be online

from bing-chat.

evankozliner avatar evankozliner commented on June 2, 2024

It is working perfectly fine on my PC but when i try to run it on my ubuntu server, it shows this error.

Friend of mine can run it from PC as well, but no dice on mac

from bing-chat.

evankozliner avatar evankozliner commented on June 2, 2024

TLDR; check your proxy and VPN settings. Maybe you're not allowing inbounds into your VPCs or similar security concerns

Ah, I figured it out! I was on my VPN. Unsure how my VPN settings were messing up the websocket connection, but for some reason, when I enter the VPN, I get HTTP 200 instead of HTTP 101 (switching protocols). Likely something in the VPN settings

from bing-chat.

ShreshthTiwari avatar ShreshthTiwari commented on June 2, 2024

But my pc or Ubuntu server is not connected to any vpn.

from bing-chat.

evankozliner avatar evankozliner commented on June 2, 2024

But my pc or Ubuntu server is not connected to any vpn.

Is your ubuntu server in an AWS VPC or similar? Could be a different networking issue

from bing-chat.

ShreshthTiwari avatar ShreshthTiwari commented on June 2, 2024

But my pc or Ubuntu server is not connected to any vpn.

Is your ubuntu server in an AWS VPC or similar? Could be a different networking issue

No, it is a hetzner node with all networks configured properly.

from bing-chat.

Agry88 avatar Agry88 commented on June 2, 2024

Got the same error on mac, didn't use VPN or something else configured about networks.

WebSocket error: Error: Unexpected server response: 200
    at ClientRequest.<anonymous> (/Users/agry/Desktop/Projects/bing-chat/node_modules/ws/lib/websocket.js:888:7)
    at ClientRequest.emit (node:events:514:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
    at TLSSocket.socketOnData (node:_http_client:535:22)
    at TLSSocket.emit (node:events:514:28)
    at addChunk (node:internal/streams/readable:343:12)
    at readableAddChunk (node:internal/streams/readable:316:9)
    at Readable.push (node:internal/streams/readable:253:10)
    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
file:///Users/agry/Desktop/Projects/bing-chat/node_modules/bing-chat/build/index.js:83
            reject(new Error(`WebSocket error: ${error.toString()}`));
                   ^

Error: WebSocket error: Error: Unexpected server response: 200
    at WebSocket.<anonymous> (file:///Users/agry/Desktop/Projects/bing-chat/node_modules/bing-chat/build/index.js:83:20)
    at WebSocket.emit (node:events:514:28)
    at emitErrorAndClose (/Users/agry/Desktop/Projects/bing-chat/node_modules/ws/lib/websocket.js:1008:13)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Node.js v20.5.0

from bing-chat.

Spxc avatar Spxc commented on June 2, 2024

I'm still not able to run this in prod. Only works on localhost. Tried multiple VPS providers, all have the same problem. It's clear it has nothing todo with VPN's or network. Something is buggy in the module

from bing-chat.

0xHristo avatar 0xHristo commented on June 2, 2024

If you set the debug flag on true you will see that the issues is whit CAPTCHA challange from Microsoft.
The full response is:

RESPONSE {
  "type": 2,
  "invocationId": "1",
  "item": {
    ....
    "telemetry": {
      "startTime": "2023-09-24T09:25:27.2693897Z"
    },
    "result": {
      "value": "CaptchaChallenge",
      "message": "User needs to solve CAPTCHA to continue.",
      "error": "User needs to solve CAPTCHA to continue.",
      "serviceVersion": "20230922.197"
    }
  }
}

As pointed by this issue to bypass the CAPTCHA promt you have to supply the client with valid _U cookie. Be aware that edge browser refresh the cookie and you have to change it frequently.

from bing-chat.

iann838 avatar iann838 commented on June 2, 2024

Tried running it on Digital Ocean, but the same issue as well, looks like we can only use it on our own machine at home where the websocket connection is coming from a genuine source and does not trigger the captcha.

from bing-chat.

ahmadkeren avatar ahmadkeren commented on June 2, 2024

somebody now how to fix that problem?

from bing-chat.

czndy avatar czndy commented on June 2, 2024

Same for me - working on local machine, but when deploying to Oracle VM, it gets that error message.

Any solutions?

from bing-chat.

nikilagar avatar nikilagar commented on June 2, 2024

Same for me on AWS.

from bing-chat.

czndy avatar czndy commented on June 2, 2024

Something that just came up to my mind is that this error might be related to the server configuration where you are hosting your code.

If anyone discover a way to fix this, please respond to this topic!

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.