Heroku app:WebSocket握手期间出错:意外的响应代码:200

时间:2018-05-10 04:41:09

标签: html5 heroku websocket

我遵循了如何制作多人俄罗斯方块游戏的教程,这里是回购: https://github.com/Leftier/tetris

它在localhost上工作正常,所以我尝试在heroku(https://tetrixtest.herokuapp.com/ --ASD中部署它以移动Q / E旋转)但是我收到以下错误:

WebSocket connection to 'wss://tetrixtest.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 200
尝试在此行中创建webSocket时尝试

(connection-manager.js第14行):

this.conn = new WebSocket(`wss://${window.location.hostname}:${window.location.port}`)

我不太了解webSockets, 起初我认为heroku无法处理websockets,但事实并非如此,所以我尝试直接使用链接作为参数,而不是从浏览器中读取它,但仍然是同样的问题。

我想了解一下为什么会发生这种情况的线索/提示,我在google和github中搜索过,但我只发现了与socket.io相关的问题

1 个答案:

答案 0 :(得分:0)

对我来说,解决方案是运行此命令select * from test where convert(datetime ,imported_date) = convert(datetime,'2020-06-16 22:00:07')

更多信息https://devcenter.heroku.com/articles/session-affinity

相关问题