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

Commit

Permalink
Support web sockets over wss
Browse files Browse the repository at this point in the history
  • Loading branch information
ahultgren committed Apr 16, 2015
1 parent 95bb07a commit dfffb54
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion source/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
var thematrix = require('./thematrix');
var blips = require('./blips');
var port = document.location.port ? ':' + document.location.port : '';
var socket = new WebSocket(`ws://${document.location.hostname}${port}`);
var scheme = document.location.protocol === 'http:' ? 'ws:' : 'wss:';
var socket = new WebSocket(`${scheme}//${document.location.hostname}${port}`);
var allowedMessages = ['LoadArticle', 'pageview', 'articleseen'];

socket.onmessage = (e) => {
Expand Down

0 comments on commit dfffb54

Please sign in to comment.