/// <summary> /// The middleware used for forwarding incoming hub messages to other servers. /// </summary> /// <param name="config">DotNetify configuration.</param> /// <param name="serverUrls">Array of URLs of the servers to forward messages to.</param> /// <param name="haltPipeline">Whether to prevent further processing in this server after forwarding messages.</param> public static IDotNetifyConfiguration UseForwarding(this IDotNetifyConfiguration config, string[] serverUrls, Action <ForwardingOptions> optionsAccessor = null) { for (int i = 0; i < serverUrls.Length; i++) { var forwardingOptions = new ForwardingOptions(); optionsAccessor?.Invoke(forwardingOptions); if (i < serverUrls.Length - 1) { forwardingOptions.HaltPipeline = false; } config.UseMiddleware <ForwardingMiddleware>(serverUrls[i], forwardingOptions); } return(config); }
public static void UseDeveloperLogging(this IDotNetifyConfiguration config, LogTraceDelegate logTraceDelegate = null) { config.UseMiddleware <DeveloperLoggingMiddleware>(logTraceDelegate ?? (log => Trace.WriteLine(log))); }
public static void UseDeveloperLogging(this IDotNetifyConfiguration config, LogTraceDelegate logTraceDelegate = null) { config.UseMiddleware <DeveloperLoggingMiddleware>(logTraceDelegate ?? (log => Logger.LogInformation(log))); }
public static void UseJwtBearerAuthentication(this IDotNetifyConfiguration config, TokenValidationParameters tokenValidationParameters) { config.UseMiddleware <JwtBearerAuthenticationMiddleware>(tokenValidationParameters); }