Skip to content
This repository has been archived by the owner on May 1, 2020. It is now read-only.

Commit

Permalink
fix(serve): use wss protocol for secure websocket when page is using …
Browse files Browse the repository at this point in the history
…https (#1358)
  • Loading branch information
rall authored and imhoffd committed Aug 24, 2018
1 parent 1e2035e commit 29c3e23
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/ion-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 29c3e23

Please sign in to comment.