Merge pull request #2510 from emanuelschuetze/protocol
Support https as websocket protocol (wss).
This commit is contained in:
commit
d2ee235293
@ -52,6 +52,13 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
var recInterval = null;
|
var recInterval = null;
|
||||||
$rootScope.connected = false;
|
$rootScope.connected = false;
|
||||||
|
|
||||||
|
var websocketProtocol;
|
||||||
|
if (location.protocol == 'https:') {
|
||||||
|
websocketProtocol = 'wss:';
|
||||||
|
} else {
|
||||||
|
websocketProtocol = 'ws:';
|
||||||
|
}
|
||||||
|
|
||||||
var websocketPath;
|
var websocketPath;
|
||||||
if (REALM == 'site') {
|
if (REALM == 'site') {
|
||||||
websocketPath = '/ws/site/';
|
websocketPath = '/ws/site/';
|
||||||
@ -73,7 +80,7 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
var newConnect = function () {
|
var newConnect = function () {
|
||||||
socket = new WebSocket('ws://' + location.host + websocketPath);
|
socket = new WebSocket(websocketProtocol + '//' + location.host + websocketPath);
|
||||||
clearInterval(recInterval);
|
clearInterval(recInterval);
|
||||||
socket.onopen = function () {
|
socket.onopen = function () {
|
||||||
$rootScope.connected = true;
|
$rootScope.connected = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user