Ejemplo n.º 1
0
 public static ServiceClientProxy CreateSingleGroupExceptProxy(this SignalR signalr, string hubName, string groupName,
                                                               IReadOnlyList <string> excludedIds)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/group/{groupName}",
                () => signalr.GenerateServerToken(hubName), excludedIds));
 }
Ejemplo n.º 2
0
        internal void UseService(SignalR signalr)
        {
            var serviceUrl  = GetServiceUrl(signalr);
            var httpOptions = new HttpOptions
            {
                JwtBearerTokenFactory = signalr.GenerateServerToken <THub>
            };

            for (var i = 0; i < signalr.ConnectionNumber; i++)
            {
                var serviceConnection = CreateServiceConnection(serviceUrl, httpOptions);
                _serviceConnections.Add(serviceConnection);
            }
        }
Ejemplo n.º 3
0
 public static ServiceClientProxy CreateAllClientsProxy(this SignalR signalr, string hubName)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}",
                () => signalr.GenerateServerToken(hubName)));
 }
Ejemplo n.º 4
0
 public static ServiceClientProxy CreateMultipleGroupProxy(this SignalR signalr, string hubName, IReadOnlyList <string> groupNames)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/groups/{string.Join(",", groupNames)}",
                () => signalr.GenerateServerToken(hubName)));
 }
Ejemplo n.º 5
0
 public static ServiceClientProxy CreateSingleUserProxy(this SignalR signalr, string hubName, string userId)
 {
     return(new ServiceClientProxy(
                $"http://{signalr.HostName}/{signalr.ApiVersion}/hub/{hubName}/user/{userId}",
                () => signalr.GenerateServerToken(hubName)));
 }
Ejemplo n.º 6
0
 public HubServerBuilder(IServiceProvider serviceProvider, SignalR signalr)
 {
     _serviceProvider = serviceProvider;
     _signalr         = signalr;
 }
Ejemplo n.º 7
0
 public HubProxy(SignalR signalr, string hubName)
 {
     _signalr = signalr;
     HubName  = hubName;
     All      = _signalr.CreateAllClientsProxy(HubName);
 }
Ejemplo n.º 8
0
 private Uri GetServiceUrl(SignalR signalr)
 {
     return(new Uri(signalr.GetServerUrl <THub>()));
 }