From cc3d78be665fe31d4dc73631b3ba7fe3577fb68f Mon Sep 17 00:00:00 2001 From: Julien Bramary Date: Fri, 16 Sep 2016 16:41:40 +0100 Subject: [PATCH] HSC-1010: support WebSocket over TLS --- .../applications/application/log-stream/log-stream.module.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js b/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js index 3305ecd0da..75245c55c7 100644 --- a/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js +++ b/src/plugins/cloud-foundry/view/applications/application/log-stream/log-stream.module.js @@ -39,7 +39,9 @@ */ function ApplicationLogStreamController(base64, modelManager, $stateParams, $location, $log) { this.model = modelManager.retrieve('cloud-foundry.model.application'); - this.websocketUrl = 'ws://' + $location.host() + '/pp/v1/' + + + var protocol = $location.protocol() === 'https' ? 'wss' : 'ws'; + this.websocketUrl = protocol + '://' + $location.host() + ':' + $location.port() + '/pp/v1/' + $stateParams.cnsiGuid + '/apps/' + $stateParams.guid + '/stream'; this.autoScrollOn = true; // auto-scroll by default