Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mnie/webrtc.healthcheck

Small utility to check if WebRTC servers are alive
https://github.com/mnie/webrtc.healthcheck

Last synced: 2 days ago
JSON representation

Small utility to check if WebRTC servers are alive

Awesome Lists containing this project

README

        

# WebRTC.Heathcheck

* NuGet Status [![NuGet](https://buildstats.info/nuget/WebRTC.Healthcheck?includePreReleases=true)](https://www.nuget.org/packages/WebRTC.Healthcheck)

Library with Healtchecks to check a health of WebRTC connection.

# How to add healthchecks

```fsharp
type Startup(configuration: IConfiguration) =
let request = {
Servers = [| Address "serverhere" |]
CredentialsConfig = Some {
OTP = Otp "otphere"
UserPostfix = Some (UserPostfix "turn")
}
}

member _.ConfigureServices(services: IServiceCollection) =
...
services.AddHealthChecks()
.AddCheck(
"WebRTC",
WebRTCHealthCheck(
request,
{ Success = Console.WriteLine
Failure = Console.WriteLine }
)
) |> ignore
services
.AddHealthChecksUI(fun s -> s.AddHealthCheckEndpoint("WebRTC", "/health") |> ignore)
.AddInMemoryStorage() |> ignore
...

member _.Configure(app: IApplicationBuilder, env: IWebHostEnvironment) =
...
app.
.UseEndpoints(fun endpoints ->
endpoints.MapControllers() |> ignore
endpoints.MapHealthChecksUI() |> ignore
endpoints.MapHealthChecks(
"/health",
HealthCheckOptions(
Predicate = (fun _ -> true),
ResponseWriter = Func(fun (context) (c: HealthReport) -> UIResponseWriter.WriteHealthCheckUIResponse(context, c))
)
) |> ignore
) |> ignore
...
```