public WebSocketConnectionsMiddleware(RequestDelegate next, WebSocketConnectionsOptions options, IWebSocketConnectionsService connectionsService, IWebSocketCompressionService compressionService) { _options = options ?? throw new ArgumentNullException(nameof(options)); _connectionsService = connectionsService ?? throw new ArgumentNullException(nameof(connectionsService)); _compressionService = compressionService ?? throw new ArgumentNullException(nameof(compressionService)); }
public static IApplicationBuilder MapWebSocketConnections(this IApplicationBuilder app, PathString pathMatch, WebSocketConnectionsOptions options) { if (app == null) { throw new ArgumentNullException(nameof(app)); } return(app.Map(pathMatch, branchedApp => branchedApp.UseMiddleware <WebSocketConnectionsMiddleware>(options))); }