Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/mnie/webrtc.healthcheck
- Owner: MNie
- License: mit
- Created: 2021-03-05T06:37:26.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-07-05T08:11:56.000Z (over 2 years ago)
- Last Synced: 2024-10-08T12:37:16.211Z (about 1 month ago)
- Language: F#
- Size: 57.6 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
...
```