A signalr based app & client to demonstrate the pushing notification , commands to clients behind private network.
.NET SignalR client , that subscribe to notification & commands from SignalR service. It also implements logic to increase/decrease the logging level based on the command from server without restarting the application A persistant bidirectional connection (Websocket) created to signalr service and receives commands & notfication. A background service receives commands and acts on it.
ASP.NET Core SignalR service, that allows clients to subscribe for notification & commands.Provides a REST API to notify & send commands to connected clients.
- Change to SignalRService directory
- Run the SignalRService server. Server will start on port 5189
dotnet run
- Change to SignalRClient directory
- Run the SignalRClient app. Client app is hardcoded to connect to server @ http://localhost5189
dotnet run
- Client print log message with default log level.
- Send Request SignalRService to increase log level of the SignalRClient using the REST API
curl "http://localhost:5189/Notify/changloglevel" -H "accept: */*" -H "Content-Type: application/json" -d "{ \"groupName\": \"configchange\", \"logLevel\": \"Trace\", \"logCategory\": \"SignalRClient.Worker\"}"
- Now you should be able to see Client pring info & trace messages
- Swagger API - http://localhost:5189/swagger