Websocket connection

Hi! I've a paid account with Pythonanywhere, and I've all files there and everything seems ok. I'm trying to create a Websocket connection from Pythonanywhere, the client is on a PC in my office to a server in another PC, but I'm unable to reach it. and here is the error message:(

Traceback (most recent call last): File "C:\venv\S_C_Connection\", line 37, in <module> File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\asyncio\", line 194, in run return ^^^^^^^^^^^^^^^^ File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\asyncio\", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\asyncio\", line 664, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "C:\venv\S_C_Connection\", line 33, in connect_to_server async with websockets.connect(ws_url) as websocket: File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\", line 629, in aenter return await self ^^^^^^^^^^ File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\", line 647, in await_impl_timeout return await self.await_impl() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\", line 654, in await_impl await protocol.handshake( File "C:\Users\malek\AppData\Local\Programs\Python\Python312\Lib\site-packages\websockets\legacy\", line 325, in handshake raise InvalidStatusCode(status_code, response_headers) websockets.exceptions.InvalidStatusCode: server rejected WebSocket connection: HTTP 404

) I need help to fix the problem.

You're getting a 404 which means that the path that you're trying to access is not on the site that you're accessing. Check that you are using the correct URL.

Hi again It was working good on local server , I've this problem when I uploaded the files to pythonanywhere and change this 'ws://' url in my client file into 'wss://' so Idont know what to do now? Where is the problem now?