我正在尝试使用Flask-SocketIO创建实时聊天室应用程序。在本地计算机上运行时,该应用程序似乎可以正常运行,但是将应用程序部署到Heroku后,Websocket无法连接,并且出现两个错误:
WebSocket connection to 'wss://cs50flack.herokuapp.com/socket.io/?
EIO=3&transport=websocket&sid=8f8e233608794661a113fadc5418c27f' failed:
Error during WebSocket handshake: Unexpected response code: 400
和:
GET https://cs50flack.herokuapp.com/socket.io/?
EIO=3&transport=polling&t=1546556762105-
66&sid=b17b8d48610842fca97cbac3e030f3bd 400 (BAD REQUEST)
代码:https://github.com/r0ss26/Flack
网址:https://cs50flack.herokuapp.com/