Merge pull request #465 from beyondcode/feature/extendable-hook
[2.x] Extendable hook
This commit is contained in:
commit
9745ca17ed
|
|
@ -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
|
||||
|
|
@ -148,7 +166,7 @@ return [
|
|||
|
|
||||
| You can enable replication to publish and subscribe to
|
||||
| messages across the driver.
|
||||
|
||||
|
|
||||
| By default, it is set to 'local', but you can configure it to use drivers
|
||||
| like Redis to ensure connection between multiple instances of
|
||||
| WebSocket servers. Just set the driver to 'redis' to enable the PubSub using Redis.
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class Router
|
|||
|
||||
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->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\Statistics\Logger\FakeStatisticsLogger;
|
||||
use BeyondCode\LaravelWebSockets\WebSockets\Channels\ChannelManager;
|
||||
use BeyondCode\LaravelWebSockets\WebSockets\WebSocketHandler;
|
||||
use Clue\React\Buzz\Browser;
|
||||
use GuzzleHttp\Psr7\Request;
|
||||
use Mockery;
|
||||
|
|
@ -32,7 +31,7 @@ abstract class TestCase extends \Orchestra\Testbench\TestCase
|
|||
{
|
||||
parent::setUp();
|
||||
|
||||
$this->pusherServer = app(WebSocketHandler::class);
|
||||
$this->pusherServer = app(config('websockets.handlers.websocket'));
|
||||
|
||||
$this->channelManager = app(ChannelManager::class);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue