想知道是否有人在 azure signalr service(v1.04) 和 angular cli(v6+) 方面有经验。在连接到集线器后,在理解如何获取客户端上下文时遇到一些问题。有什么想法吗?
这是集线器的上下文,任何帮助将不胜感激!
this.getConnectionInfo().subscribe(info => {
console.log("INFO", info);
let options = {
accessTokenFactory: () => info.accessToken
};
this.hubConnection = new signalR.HubConnectionBuilder()
.withUrl(info.hubUrl, options)
.configureLogging(signalR.LogLevel.Information)
.build();
this.hubConnection.start().then(() => {
console.log('Hub connection started init');
**[GET hubConnectionContext]**
console.log('Connection', this.hubConnection);
})
.catch(err => console.error(err.toString()));