[ADF-5349] WebSocket protocol based on BpmHost (#6745)

This commit is contained in:
davidcanonieto
2021-03-01 09:14:28 +01:00
committed by GitHub
parent a47045ab18
commit 97dc9b2840

View File

@@ -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,