1 override of WebSockets
Microsoft.AspNetCore.Http (1)
DefaultHttpContext.cs (1)
151public override WebSocketManager WebSockets => _websockets ?? (_websockets = new DefaultWebSocketManager(Features));
97 references to WebSockets
AutobahnTestApp (2)
Startup.cs (2)
18if (context.WebSockets.IsWebSocketRequest) 21using (var webSocket = await context.WebSockets.AcceptWebSocketAsync(new WebSocketAcceptContext()
ExceptionHandlerSample (2)
StartupWithWebSocket.cs (2)
29if (context.WebSockets.IsWebSocketRequest) 31using var ws = await context.WebSockets.AcceptWebSocketAsync();
Interop.FunctionalTests (4)
Http2WebSocketInteropTests.cs (4)
62Assert.True(context.WebSockets.IsWebSocketRequest); 63var ws = await context.WebSockets.AcceptWebSocketAsync(); 115Assert.True(context.WebSockets.IsWebSocketRequest); 116var ws = await context.WebSockets.AcceptWebSocketAsync();
JwtSample (1)
Startup.cs (1)
50(context.HttpContext.WebSockets.IsWebSocketRequest || context.Request.Headers["Accept"] == "text/event-stream"))
Microsoft.AspNetCore.Components.Server (1)
DependencyInjection\ServerRazorComponentsBuilderExtensions.cs (1)
94if (ctx.WebSockets.IsWebSocketRequest)
Microsoft.AspNetCore.Http.Connections (4)
Internal\HttpConnectionDispatcher.cs (1)
167if (context.WebSockets.IsWebSocketRequest)
Internal\Transports\WebSocketsServerTransport.cs (3)
39Debug.Assert(context.WebSockets.IsWebSocketRequest, "Not a websocket request"); 41var subProtocol = _options.SubProtocolSelector?.Invoke(context.WebSockets.WebSocketRequestedProtocols); 43using (var ws = await context.WebSockets.AcceptWebSocketAsync(subProtocol))
Microsoft.AspNetCore.Http.Connections.Tests (2)
HttpConnectionDispatcherTests.cs (2)
3223(context.HttpContext.WebSockets.IsWebSocketRequest || context.Request.Headers["Accept"] == "text/event-stream")) 3385(context.HttpContext.WebSockets.IsWebSocketRequest || context.Request.Headers["Accept"] == "text/event-stream"))
Microsoft.AspNetCore.Http.Tests (2)
DefaultHttpContextTests.cs (2)
330TestCachedFeaturesAreNull(context.WebSockets, features); 358TestCachedFeaturesAreSet(context.WebSockets, features);
Microsoft.AspNetCore.Owin (1)
OwinEnvironment.cs (1)
127if (context.WebSockets.IsWebSocketRequest)
Microsoft.AspNetCore.SignalR.Tests (1)
Startup.cs (1)
59(context.HttpContext.WebSockets.IsWebSocketRequest || context.Request.Headers["Accept"] == "text/event-stream"))
Microsoft.AspNetCore.SpaServices.Extensions (3)
Proxying\SpaProxy.cs (3)
78if (context.WebSockets.IsWebSocketRequest) 216foreach (var protocol in context.WebSockets.WebSocketRequestedProtocols) 260using (var server = await context.WebSockets.AcceptWebSocketAsync(client.SubProtocol))
Microsoft.AspNetCore.TestHost.Tests (17)
TestClientTests.cs (15)
580if (ctx.WebSockets.IsWebSocketRequest) 583var websocket = await ctx.WebSockets.AcceptWebSocketAsync(); 649if (ctx.WebSockets.IsWebSocketRequest) 651if (ctx.WebSockets.WebSocketRequestedProtocols.Contains("alpha") && 652ctx.WebSockets.WebSocketRequestedProtocols.Contains("bravo")) 657var websocket = await ctx.WebSockets.AcceptWebSocketAsync("charlie"); 662var subprotocols = ctx.WebSockets.WebSocketRequestedProtocols.Any() 663? string.Join(", ", ctx.WebSockets.WebSocketRequestedProtocols) 666var websocket = await ctx.WebSockets.AcceptWebSocketAsync(); 703if (ctx.WebSockets.IsWebSocketRequest) 705var websocket = await ctx.WebSockets.AcceptWebSocketAsync(); 760if (ctx.WebSockets.IsWebSocketRequest) 762var websocket = await ctx.WebSockets.AcceptWebSocketAsync(); 787if (ctx.WebSockets.IsWebSocketRequest) 789var websocket = await ctx.WebSockets.AcceptWebSocketAsync();
WebSocketClientTests.cs (2)
67if (ctx.WebSockets.IsWebSocketRequest) 69using var websocket = await ctx.WebSockets.AcceptWebSocketAsync();
Microsoft.AspNetCore.WebSockets.Tests (57)
Http2WebSocketTests.cs (3)
28Assert.True(httpContext.WebSockets.IsWebSocketRequest); 29Assert.Equal(new[] { "p1", "p2" }, httpContext.WebSockets.WebSocketRequestedProtocols); 30return httpContext.WebSockets.AcceptWebSocketAsync("p2");
WebSocketCompressionMiddlewareTests.cs (8)
20Assert.True(context.WebSockets.IsWebSocketRequest); 21var webSocket = await context.WebSockets.AcceptWebSocketAsync(new WebSocketAcceptContext() 52Assert.True(context.WebSockets.IsWebSocketRequest); 53var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 82Assert.True(context.WebSockets.IsWebSocketRequest); 83var webSocket = await context.WebSockets.AcceptWebSocketAsync(new WebSocketAcceptContext() 115Assert.True(context.WebSockets.IsWebSocketRequest); 116using var webSocket = await context.WebSockets.AcceptWebSocketAsync(new WebSocketAcceptContext()
WebSocketMiddlewareTests.cs (46)
23Assert.True(context.WebSockets.IsWebSocketRequest); 24var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 39Assert.True(context.WebSockets.IsWebSocketRequest); 41var webSocket = await context.WebSockets.AcceptWebSocketAsync("Bravo"); 67Assert.True(context.WebSockets.IsWebSocketRequest); 68var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 92Assert.True(context.WebSockets.IsWebSocketRequest); 93var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 117Assert.True(context.WebSockets.IsWebSocketRequest); 118var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 143Assert.True(context.WebSockets.IsWebSocketRequest); 144var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 174Assert.True(context.WebSockets.IsWebSocketRequest); 175var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 223Assert.True(context.WebSockets.IsWebSocketRequest); 224var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 248Assert.True(context.WebSockets.IsWebSocketRequest); 249var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 273Assert.True(context.WebSockets.IsWebSocketRequest); 274var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 306Assert.True(context.WebSockets.IsWebSocketRequest); 307var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 349Assert.True(context.WebSockets.IsWebSocketRequest); 350var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 377Assert.True(context.WebSockets.IsWebSocketRequest); 378var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 405Assert.True(context.WebSockets.IsWebSocketRequest); 406var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 435Assert.True(context.WebSockets.IsWebSocketRequest); 436var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 467Assert.True(context.WebSockets.IsWebSocketRequest); 468var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 516Assert.True(context.WebSockets.IsWebSocketRequest); 517serverSocket = await context.WebSockets.AcceptWebSocketAsync(); 591Assert.True(context.WebSockets.IsWebSocketRequest); 592serverSocket = await context.WebSockets.AcceptWebSocketAsync(); 655Assert.True(context.WebSockets.IsWebSocketRequest); 698Assert.False(context.WebSockets.IsWebSocketRequest); 724Assert.True(context.WebSockets.IsWebSocketRequest); 725var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 745Assert.True(context.WebSockets.IsWebSocketRequest); 746var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 782Assert.True(context.WebSockets.IsWebSocketRequest); 786var webSocket = await context.WebSockets.AcceptWebSocketAsync(); 806Assert.True(context.WebSockets.IsWebSocketRequest); 807var webSocket = await context.WebSockets.AcceptWebSocketAsync();