I'm new to SignalR. I have a jQuery code below, which allows to connect to the hub successfully.
Now I need to subscribe to an event, lets just say, someEvent
. How can I do that? Transport type according to logs: serverSentEvents
.
By the way, server side code is a black box for me, I have only name of the event...
var hub = $.hubConnection("https://someurl/");
hub.logging = true;
hub.start()
.done(function () {
console.log(`Connected... Hub id: ${hub.id}`);
console.log("Transport = " + hub.transport.name);
console.log(hub);
})
.fail(function (err) {
console.log(`Not connected: ${err}`);
});