This commit is contained in:
parent
bc0c7121ef
commit
52534500d8
|
|
@ -7,8 +7,20 @@ using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Builder
|
namespace Microsoft.AspNetCore.Builder
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="IApplicationBuilder" /> extension methods to add and configure <see cref="WebSocketMiddleware" />.
|
||||||
|
/// </summary>
|
||||||
public static class WebSocketMiddlewareExtensions
|
public static class WebSocketMiddlewareExtensions
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the <see cref="WebSocketMiddleware" /> to the request pipeline.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="app">
|
||||||
|
/// The <see cref="IApplicationBuilder" /> to configure.
|
||||||
|
/// </param>
|
||||||
|
/// <returns>
|
||||||
|
/// The <see cref="IApplicationBuilder" />.
|
||||||
|
/// </returns>
|
||||||
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app)
|
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app)
|
||||||
{
|
{
|
||||||
if (app == null)
|
if (app == null)
|
||||||
|
|
@ -19,6 +31,18 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
return app.UseMiddleware<WebSocketMiddleware>();
|
return app.UseMiddleware<WebSocketMiddleware>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Adds the <see cref="WebSocketMiddleware" /> to the request pipeline.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="app">
|
||||||
|
/// The <see cref="IApplicationBuilder" /> to configure.
|
||||||
|
/// </param>
|
||||||
|
/// <param name="options">
|
||||||
|
/// The <see cref="WebSocketOptions" /> to be used for the <see cref="WebSocketMiddleware" />.
|
||||||
|
/// </param>
|
||||||
|
/// <returns>
|
||||||
|
/// The <see cref="IApplicationBuilder" />.
|
||||||
|
/// </returns>
|
||||||
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app, WebSocketOptions options)
|
public static IApplicationBuilder UseWebSockets(this IApplicationBuilder app, WebSocketOptions options)
|
||||||
{
|
{
|
||||||
if (app == null)
|
if (app == null)
|
||||||
|
|
@ -33,4 +57,4 @@ namespace Microsoft.AspNetCore.Builder
|
||||||
return app.UseMiddleware<WebSocketMiddleware>(Options.Create(options));
|
return app.UseMiddleware<WebSocketMiddleware>(Options.Create(options));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,9 @@ using Microsoft.Extensions.DependencyInjection;
|
||||||
|
|
||||||
namespace Microsoft.AspNetCore.Hosting
|
namespace Microsoft.AspNetCore.Hosting
|
||||||
{
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// <see cref="IWebHostBuilder" /> extension methods to configure the Socket transport to be used by Kestrel.
|
||||||
|
/// </summary>
|
||||||
public static class WebHostBuilderSocketExtensions
|
public static class WebHostBuilderSocketExtensions
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue