Open inactivist opened 3 years ago
@inactivist Hey thank you for reporting this information. I'll test it out with sanic mode and update the docs accordingly! Thank you once again ππ
@inactivist I'll add transport mode option to SocketManager
constructor
(This may be a documentation issue -- in any case, this may be helpful to someone else)
EDIT I see this problem is mentioned in issue #2, but I didn't make the connection until after creating this issue.
I encountered a problem where Chrome refused to upgrade the connection, due to multiple CORS header being returned in the server response, when using
fastapi.CORSMiddleware
and setting allowed origins in both placesSeem obvious now, but setting both
allow_origins
inCORSMiddleware
, andcors_allowed_origins
infastapi-socketio
causes duplicate headers to be returned to the client (which causes errors in Chrome, and the connection isn't upgraded)Related to python-socketio issue 205 -- this response recommends
async_mode='sanic'
andcors_allowed_origins=[]
in the constructor:I've confirmed that passing
cors_allowed_origins=[]
in theSocketManager()
constructor resolves the issue in this situation.(See also this issue)