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))); }
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)); }