3
votes

I followed a tutorial on how to make a multiplayer tetris game, here is the repo: https://github.com/Leftier/tetris

It worked just fine on localhost so I tried to deploy it in heroku (https://tetrixtest.herokuapp.com/ --ASD to move Q/E to rotate) but I get the following error:

WebSocket connection to 'wss://tetrixtest.herokuapp.com/' failed: Error during WebSocket handshake: Unexpected response code: 200

while trying to create the webSocket in this line (connection-manager.js line 14):

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

I don't know much about webSockets, at first I thought that heroku was not able to handle websockets but that wasn't the case so I tried using the link directly as an argument instead of reading it from the browser but still the same issue.

I would like some clues/hints about why does this happens, I searched in google and github, but I only found issues related to socket.io

1

1 Answers

0
votes

For me the solution was to run this command heroku features:enable http-session-affinity

More info https://devcenter.heroku.com/articles/session-affinity