Sometimes in new versions signalrwe need to work on old code and old versions and this is very troublesome. The link below with sample code can be a good guide for this type of problem.
var connection = new signalR.HubConnectionBuilder()
.withUrl(ArianCore.GlobInfo.ApiUrl + "apiHub?", {
headers: { "token": getToketAuth() },
transport: signalR.HttpTransportType.LongPolling
}
)
.build();