acheong08 / EdgeGPT

Reverse engineered API of Microsoft's Bing Chat AI
The Unlicense
8.07k stars 909 forks source link

websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200 #603

Open HerbertArthur opened 1 year ago

HerbertArthur commented 1 year ago

Is there an existing issue for this?

What would your feature do ?

I had the same problem. https://github.com/acheong08/EdgeGPT/issues/584

Logs: Traceback (most recent call last): File "/Users/yehebin/work/baidu/personal-code/yehebin-tools/test/test_gpt.py", line 29, in <module> asyncio.run(main()) File "/Users/yehebin/program/miniforge3/lib/python3.9/asyncio/runners.py", line 44, in run return loop.run_until_complete(main) File "/Users/yehebin/program/miniforge3/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete return future.result() File "/Users/yehebin/work/baidu/personal-code/yehebin-tools/test/test_gpt.py", line 11, in main response = await bot.ask( File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/EdgeGPT/EdgeGPT.py", line 116, in ask async for final, response in self.chat_hub.ask_stream( File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/EdgeGPT/chathub.py", line 102, in ask_stream async with connect( File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/websockets/legacy/client.py", line 637, in __aenter__ return await self File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/websockets/legacy/client.py", line 655, in __await_impl_timeout__ return await self.__await_impl__() File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/websockets/legacy/client.py", line 662, in __await_impl__ await protocol.handshake( File "/Users/yehebin/program/miniforge3/lib/python3.9/site-packages/websockets/legacy/client.py", line 329, in handshake raise InvalidStatusCode(status_code, response_headers) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 200

Proposed workflow

Null

Additional information

I already tried EdgeGPT 0.11.0 0.12.1, can't work.

My env: OS: mac os I access new bing by proxy, proxy works good. I can access new bing by browser.

DrowskoytayhulGuider commented 1 year ago

Do you use Clash. If you use it, you can try to install the Service Mode and then open TUN mode.

xiahan4956 commented 1 year ago

I have used Clash. When I use it in my surface8,it works. But when I use the tun mode in my surface5,it does't work....why....

DrowskoytayhulGuider commented 1 year ago

I have used Clash. When I use it in my surface8,it works. But when I use the tun mode in my surface5,it does't work....why....

Maybe you have to install the Service Mode first.

xiahan4956 commented 1 year ago

I have used Clash. When I use it in my surface8,it works. But when I use the tun mode in my surface5,it does't work....why....

Maybe you have to install the Service Mode first.

You are right! Thanks very much

HerbertArthur commented 1 year ago

I have used Clash. When I use it in my surface8,it works. But when I use the tun mode in my surface5,it does't work....why....

Maybe you have to install the Service Mode first.

You are right! Thanks very much

Yes, I am use Clash proxy tools. Open TUN mode does not work too.

lovelf commented 1 year ago

server rejected WebSocket connection, this is what problem

XGY4n commented 1 year ago

Do you use Clash. If you use it, you can try to install the Service Mode and then open TUN mode.

thanks it's works for me !

turbobin commented 1 year ago

Do you use Clash. If you use it, you can try to install the Service Mode and then open TUN mode.

I use clash-linux-amd64-v1.13.0 in my centos system,how can I open TUN mode? I used to solve this problem by using proxychains,but now it suddenly doesn't work for me