Skip to content

Commit

Permalink
Default to WS only, no polling for Socket.IO
Browse files Browse the repository at this point in the history
  • Loading branch information
btouellette committed Sep 4, 2020
1 parent 1185d9a commit 44725f9
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion views/game.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,14 @@ userGames.sort(function(a,b) { return (a.lastModified < b.lastModified) ? 1 : ((
var userFriends = <%- JSON.stringify(user.friends) %>;
var userID = '<%- user._id %>';
var socket = io.connect('<%- process.env.SOCKET_URL %>');
// Disabling HTTPS/polling transport initially as this is causing H12 errors on Heroku, allow polling on reconnect if initial connection fails
var socket = io.connect('<%- process.env.SOCKET_URL %>', {
transports: ['websocket']
});
socket.on('reconnect_attempt', () => {
socket.io.opts.transports = ['polling', 'websocket'];
});
var currentGameID, selectedMove, svgHeight, svgWidth;
var meeplePlacementMode = 'normal';
Expand Down

0 comments on commit 44725f9

Please sign in to comment.