pyropy / fastapi-socketio

Easily integrate socket.io with your FastAPI app 🚀
Apache License 2.0
328 stars 31 forks source link

403 Forbidden - connection failed #39

Open meerasndr opened 1 year ago

meerasndr commented 1 year ago

I am trying to run the example app. Only change is port number 8002 in my code. I see this error when I try to make a WebSocket request to the server from Postman

Error: Unexpected server response: 403
Handshake Details
Request URL: http://localhost:8002/socket.io/?EIO=4&transport=websocket
Request Method: GET
Status Code: 403 Forbidden
Request Headers
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: fKVQf5eYrPb4tfZx6iHFEg==
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Extensions: permessage-deflate; client_max_window_bits
Host: localhost:8002
Response Headers
Date: Thu, 22 Dec 2022 04:43:26 GMT
Content-Length: 0
Content-Type: text/plain
Connection: close

How can this be fixed? Appreciate any pointers.

samhiggsrio commented 1 year ago

Has this got a fix. I am running into the same issue.

EddyJensR commented 1 year ago

Same here

pavel-sakun commented 1 year ago

Had that same error as well with postman. Fixed by specifying Handshake path at Settings tab as "/ws/socket.io".