From f67427cfcdab343055a899f7673b1bc049fc9e8b Mon Sep 17 00:00:00 2001 From: Richard Allaway Date: Fri, 29 Dec 2017 16:11:46 -0500 Subject: [PATCH] use wss protocol for secure websocket when page is using https --- bin/ion-dev.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bin/ion-dev.js b/bin/ion-dev.js index c07ee04a..e8643459 100644 --- a/bin/ion-dev.js +++ b/bin/ion-dev.js @@ -98,7 +98,8 @@ window.IonicDevServer = { openConnection: function() { var self = this; - this.socket = new WebSocket('ws://' + window.location.hostname + ':' + IonicDevServerConfig.wsPort); + var socketProtocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'; + this.socket = new WebSocket(socketProtocol + '//' + window.location.hostname + ':' + IonicDevServerConfig.wsPort); this.socket.onopen = function(ev) { self.socketReady = true;