EdgeGPT icon indicating copy to clipboard operation
EdgeGPT copied to clipboard

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

Open HerbertArthur opened this issue 2 years ago • 8 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues and checked the recent builds/commits

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.

HerbertArthur avatar Jul 11 '23 09:07 HerbertArthur

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

DrowskoytayhulGuider avatar Jul 11 '23 12:07 DrowskoytayhulGuider

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....

xiahan4956 avatar Jul 12 '23 01:07 xiahan4956

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.

DrowskoytayhulGuider avatar Jul 12 '23 01:07 DrowskoytayhulGuider

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

xiahan4956 avatar Jul 12 '23 01:07 xiahan4956

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.

HerbertArthur avatar Jul 12 '23 02:07 HerbertArthur

server rejected WebSocket connection, this is what problem

lovelf avatar Jul 12 '23 03:07 lovelf

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 !

XGY4n avatar Jul 14 '23 05:07 XGY4n

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

turbobin avatar Jul 19 '23 13:07 turbobin