Skip to content

Commit

Permalink
Fix window.location.protocol issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Zhou committed Feb 17, 2020
1 parent e6d0415 commit 199d5ef
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/client/networking.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { processGameUpdate } from './state';

const Constants = require('../shared/constants');

const socketProtocol = (window.location.protocol === 'https') ? 'wss' : 'ws';
const socketProtocol = (window.location.protocol.includes('https')) ? 'wss' : 'ws';
const socket = io(`${socketProtocol}://${window.location.host}`, { reconnection: false });
const connectedPromise = new Promise(resolve => {
socket.on('connect', () => {
Expand Down

0 comments on commit 199d5ef

Please sign in to comment.