Skip to content

Commit c0847e7

Browse files
committed
fixing invalid scheme issue when connecting to web sockets
1 parent bbbbe41 commit c0847e7

File tree

2 files changed

+367
-321
lines changed

2 files changed

+367
-321
lines changed

packages/mgt-chat/src/statefulClient/GraphNotificationClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ type Notification = {
3333
encryptedContent: string;
3434
};
3535

36+
const stripWssScheme = (notificationUrl: string): string => notificationUrl.replace('wss:', '');
37+
3638
export class GraphNotificationClient {
3739
private connection?: signalR.HubConnection = undefined;
3840
private renewalInterval = -1;
@@ -240,7 +242,7 @@ export class GraphNotificationClient {
240242
withCredentials: false
241243
};
242244
const connection = new signalR.HubConnectionBuilder()
243-
.withUrl(notificationUrl, connectionOptions)
245+
.withUrl(stripWssScheme(notificationUrl), connectionOptions)
244246
.withAutomaticReconnect()
245247
.configureLogging(signalR.LogLevel.Information)
246248
.build();

0 commit comments

Comments
 (0)