From 97dc9b28408c6e80286d93af023da3968f953467 Mon Sep 17 00:00:00 2001 From: davidcanonieto Date: Mon, 1 Mar 2021 09:14:28 +0100 Subject: [PATCH] [ADF-5349] WebSocket protocol based on BpmHost (#6745) --- .../src/lib/services/notification-cloud.service.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts b/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts index c31f4fa0fa..721c52b700 100644 --- a/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts +++ b/lib/process-services-cloud/src/lib/services/notification-cloud.service.ts @@ -39,8 +39,12 @@ export class NotificationCloudService extends BaseCloudService { super(apiService, appConfigService); } - private getUrlDomain(appName: string) { - return this.getBasePath(appName).split('://')[1]; + private get webSocketHost() { + return this.contextRoot.split('://')[1]; + } + + private get protocol() { + return this.contextRoot.split('://')[0] === 'https' ? 'wss' : 'ws'; } initNotificationsForApp(appName: string) { @@ -51,7 +55,7 @@ export class NotificationCloudService extends BaseCloudService { }); const webSocketLink = new WebSocketLink({ - uri: `wss://${this.getUrlDomain(appName)}/notifications/ws/graphql`, + uri: `${this.protocol}://${this.webSocketHost}/${appName}/notifications/ws/graphql`, options: { reconnect: true, lazy: true,