mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
28 lines
612 B
TypeScript
28 lines
612 B
TypeScript
|
|
import { Injectable } from '@angular/core';
|
||
|
|
import * as signalR from "@microsoft/signalr"
|
||
|
|
import { SessionStore } from '../store/session.service';
|
||
|
|
|
||
|
|
|
||
|
|
@Injectable({
|
||
|
|
providedIn: 'root'
|
||
|
|
})
|
||
|
|
export class SocketConnectionMCRService {
|
||
|
|
|
||
|
|
constructor() { }
|
||
|
|
|
||
|
|
connect() {
|
||
|
|
|
||
|
|
var connection = new signalR.HubConnectionBuilder()
|
||
|
|
.withUrl("https://gdcmapi-dev.dyndns.info/FileHub", {
|
||
|
|
accessTokenFactory: () => SessionStore.user.Authorization
|
||
|
|
}).configureLogging(signalR.LogLevel.Information)
|
||
|
|
.build()
|
||
|
|
|
||
|
|
|
||
|
|
connection.on("ReceiveMessage", (message) => {
|
||
|
|
console.log(message)
|
||
|
|
})
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|