- Add Metered and ConvexSol (CoTURN) provider drivers with response validation and caching - Add IceCandidateManager with automatic failover and structured logging - Add IceCandidateProviderInterface and DTOs conforming to RTCIceServer format
39 lines
977 B
PHP
39 lines
977 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Contracts\IceCandidateProviderInterface;
|
|
use App\Services\IceCandidate\IceCandidateManager;
|
|
use Illuminate\Contracts\Support\DeferrableProvider;
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class IceCandidateServiceProvider extends ServiceProvider implements DeferrableProvider
|
|
{
|
|
/**
|
|
* Register services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
$this->app->singleton(IceCandidateManager::class, function ($app) {
|
|
return new IceCandidateManager($app);
|
|
});
|
|
|
|
$this->app->bind(IceCandidateProviderInterface::class, function ($app) {
|
|
return $app->make(IceCandidateManager::class);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Get the services provided by the provider.
|
|
*
|
|
* @return array<int, string>
|
|
*/
|
|
public function provides(): array
|
|
{
|
|
return [
|
|
IceCandidateManager::class,
|
|
IceCandidateProviderInterface::class,
|
|
];
|
|
}
|
|
}
|