Added extension for the websocket handler
This commit is contained in:
parent
99a48d501c
commit
13978cb824
|
|
@ -141,6 +141,24 @@ return [
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
|
/*
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
| Route Handlers
|
||||||
|
|--------------------------------------------------------------------------
|
||||||
|
|
|
||||||
|
| Here you can specify the route handlers that will take over
|
||||||
|
| the incoming/outgoing websocket connections. You can extend the
|
||||||
|
| original class and implement your own logic, alongside
|
||||||
|
| with the existing logic.
|
||||||
|
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
'handlers' => [
|
||||||
|
|
||||||
|
'websocket' => \BeyondCode\LaravelWebSockets\WebSockets\WebSocketHandler::class,
|
||||||
|
|
||||||
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
| Broadcasting Replication PubSub
|
| Broadcasting Replication PubSub
|
||||||
|
|
@ -148,7 +166,7 @@ return [
|
||||||
|
|
|
|
||||||
| You can enable replication to publish and subscribe to
|
| You can enable replication to publish and subscribe to
|
||||||
| messages across the driver.
|
| messages across the driver.
|
||||||
|
|
|
||||||
| By default, it is set to 'local', but you can configure it to use drivers
|
| By default, it is set to 'local', but you can configure it to use drivers
|
||||||
| like Redis to ensure connection between multiple instances of
|
| like Redis to ensure connection between multiple instances of
|
||||||
| WebSocket servers. Just set the driver to 'redis' to enable the PubSub using Redis.
|
| WebSocket servers. Just set the driver to 'redis' to enable the PubSub using Redis.
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@ class Router
|
||||||
|
|
||||||
public function echo()
|
public function echo()
|
||||||
{
|
{
|
||||||
$this->get('/app/{appKey}', WebSocketHandler::class);
|
$this->get('/app/{appKey}', config('websockets.handlers.websocket', WebSocketHandler::class));
|
||||||
|
|
||||||
$this->post('/apps/{appId}/events', TriggerEventController::class);
|
$this->post('/apps/{appId}/events', TriggerEventController::class);
|
||||||
$this->get('/apps/{appId}/channels', FetchChannelsController::class);
|
$this->get('/apps/{appId}/channels', FetchChannelsController::class);
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ use BeyondCode\LaravelWebSockets\Tests\Mocks\Connection;
|
||||||
use BeyondCode\LaravelWebSockets\Tests\Mocks\Message;
|
use BeyondCode\LaravelWebSockets\Tests\Mocks\Message;
|
||||||
use BeyondCode\LaravelWebSockets\Tests\Statistics\Logger\FakeStatisticsLogger;
|
use BeyondCode\LaravelWebSockets\Tests\Statistics\Logger\FakeStatisticsLogger;
|
||||||
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
|
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
|
||||||
use BeyondCode\LaravelWebSockets\WebSockets\WebSocketHandler;
|
|
||||||
use Clue\React\Buzz\Browser;
|
use Clue\React\Buzz\Browser;
|
||||||
use GuzzleHttp\Psr7\Request;
|
use GuzzleHttp\Psr7\Request;
|
||||||
use Mockery;
|
use Mockery;
|
||||||
|
|
@ -32,7 +31,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
||||||
{
|
{
|
||||||
parent::setUp();
|
parent::setUp();
|
||||||
|
|
||||||
$this->pusherServer = app(WebSocketHandler::class);
|
$this->pusherServer = app(config('websockets.handlers.websocket'));
|
||||||
|
|
||||||
$this->channelManager = app(ChannelManager::class);
|
$this->channelManager = app(ChannelManager::class);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue