Skip to content
This repository has been archived by the owner on Apr 15, 2019. It is now read-only.

Commit

Permalink
Adjust protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
Gina Contrino committed Nov 2, 2017
1 parent bbe08e3 commit 15fbafa
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/store/middlewares/socket.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ const socketSetup = (store) => {
ipc.on('blur', () => { windowIsFocused = false; });
ipc.on('focus', () => { windowIsFocused = true; });
}
connection = io.connect(`ws://${store.getState().peers.data.currentPeer}:${store.getState().peers.data.port}`);

const ssl = store.getState().peers.data.options.ssl;
const protocol = ssl ? 'https' : 'http';

connection = io.connect(`${protocol}://${store.getState().peers.data.currentPeer}:${store.getState().peers.data.port}`);
connection.on('blocks/change', (block) => {
store.dispatch({
type: actionTypes.newBlockCreated,
Expand Down

0 comments on commit 15fbafa

Please sign in to comment.