mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
[ADF-5349] WebSocket protocol based on BpmHost (#6745)
This commit is contained in:
@@ -39,8 +39,12 @@ export class NotificationCloudService extends BaseCloudService {
|
|||||||
super(apiService, appConfigService);
|
super(apiService, appConfigService);
|
||||||
}
|
}
|
||||||
|
|
||||||
private getUrlDomain(appName: string) {
|
private get webSocketHost() {
|
||||||
return this.getBasePath(appName).split('://')[1];
|
return this.contextRoot.split('://')[1];
|
||||||
|
}
|
||||||
|
|
||||||
|
private get protocol() {
|
||||||
|
return this.contextRoot.split('://')[0] === 'https' ? 'wss' : 'ws';
|
||||||
}
|
}
|
||||||
|
|
||||||
initNotificationsForApp(appName: string) {
|
initNotificationsForApp(appName: string) {
|
||||||
@@ -51,7 +55,7 @@ export class NotificationCloudService extends BaseCloudService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const webSocketLink = new WebSocketLink({
|
const webSocketLink = new WebSocketLink({
|
||||||
uri: `wss://${this.getUrlDomain(appName)}/notifications/ws/graphql`,
|
uri: `${this.protocol}://${this.webSocketHost}/${appName}/notifications/ws/graphql`,
|
||||||
options: {
|
options: {
|
||||||
reconnect: true,
|
reconnect: true,
|
||||||
lazy: true,
|
lazy: true,
|
||||||
|
Reference in New Issue
Block a user