Skip to content

Commit

Permalink
AAE-20808 Fixed websocket protocol
Browse files Browse the repository at this point in the history
  • Loading branch information
ehsan-2019 committed Nov 26, 2024
1 parent 2d3c684 commit 3c39816
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import { createClient } from 'graphql-ws';
import { Inject, Injectable } from '@angular/core';
import { AppConfigService, AuthenticationService } from '@alfresco/adf-core';
import { AuthenticationService } from '@alfresco/adf-core';
import { GraphQLWsLink } from '@apollo/client/link/subscriptions';
import { WebSocketLink } from '@apollo/client/link/ws';
import {
Expand Down Expand Up @@ -59,11 +59,12 @@ export class WebSocketService {

constructor(
private readonly apollo: Apollo,
private readonly appConfigService: AppConfigService,
// private readonly appConfigService: AppConfigService,
private readonly authService: AuthenticationService,
@Inject(FeaturesServiceToken) private featuresService: IFeaturesService
) {
this.host = this.appConfigService.get('bpmHost', '');
this.host = 'https://aae-rc-apa.envalfresco.com';
// this.host = this.appConfigService.get('bpmHost', '');
}

public getSubscription<T>(options: serviceOptions): Observable<FetchResult<T>> {
Expand Down Expand Up @@ -91,7 +92,8 @@ export class WebSocketService {

private createWsUrl(serviceUrl: string): string {
const url = new URL(serviceUrl, this.host);
url.protocol = url.protocol === 'https' ? 'wss' : 'ws';
const protocol = url.protocol === 'https:' ? 'wss:' : 'ws:';
url.protocol = protocol;

return url.href;
}
Expand Down

0 comments on commit 3c39816

Please sign in to comment.