mirror of
https://github.com/yawaflua/WebSockets.git
synced 2025-12-10 04:19:33 +02:00
Adds onOpenHandler
This commit is contained in:
@@ -8,11 +8,12 @@ namespace yawaflua.WebSockets;
|
||||
|
||||
public static class ServiceBindings
|
||||
{
|
||||
public static IServiceCollection SettingUpWebSockets(this IServiceCollection isc)
|
||||
public static IServiceCollection SettingUpWebSockets(this IServiceCollection isc, Action<WebSocketOptions>? socketOptions = null)
|
||||
{
|
||||
isc.AddSingleton<WebSocketRouter>();
|
||||
isc.AddScoped<IWebSocketManager, WebSocketManager>();
|
||||
isc.AddSingleton<WebSocketMiddleware>();
|
||||
isc.Configure("WebSocketOptions", socketOptions);
|
||||
return isc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user