This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 141141
142142 ],
143143
144+ /*
145+ |--------------------------------------------------------------------------
146+ | Route Handlers
147+ |--------------------------------------------------------------------------
148+ |
149+ | Here you can specify the route handlers that will take over
150+ | the incoming/outgoing websocket connections. You can extend the
151+ | original class and implement your own logic, alongside
152+ | with the existing logic.
153+ |
154+ */
155+
156+ 'handlers ' => [
157+
158+ 'websocket ' => \BeyondCode \LaravelWebSockets \WebSockets \WebSocketHandler::class,
159+
160+ ],
161+
144162 /*
145163 |--------------------------------------------------------------------------
146164 | Broadcasting Replication PubSub
147165 |--------------------------------------------------------------------------
148166 |
149167 | You can enable replication to publish and subscribe to
150168 | messages across the driver.
151-
169+ |
152170 | By default, it is set to 'local', but you can configure it to use drivers
153171 | like Redis to ensure connection between multiple instances of
154172 | WebSocket servers. Just set the driver to 'redis' to enable the PubSub using Redis.
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public function getRoutes(): RouteCollection
3434
3535 public function echo ()
3636 {
37- $ this ->get ('/app/{appKey} ' , WebSocketHandler::class);
37+ $ this ->get ('/app/{appKey} ' , config ( ' websockets.handlers.websocket ' , WebSocketHandler::class) );
3838
3939 $ this ->post ('/apps/{appId}/events ' , TriggerEventController::class);
4040 $ this ->get ('/apps/{appId}/channels ' , FetchChannelsController::class);
Original file line number Diff line number Diff line change 1010use BeyondCode \LaravelWebSockets \Tests \Mocks \Message ;
1111use BeyondCode \LaravelWebSockets \Tests \Statistics \Logger \FakeStatisticsLogger ;
1212use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManager ;
13- use BeyondCode \LaravelWebSockets \WebSockets \WebSocketHandler ;
1413use Clue \React \Buzz \Browser ;
1514use GuzzleHttp \Psr7 \Request ;
1615use Mockery ;
@@ -32,7 +31,7 @@ public function setUp(): void
3231 {
3332 parent ::setUp ();
3433
35- $ this ->pusherServer = app (WebSocketHandler::class );
34+ $ this ->pusherServer = app (config ( ' websockets.handlers.websocket ' ) );
3635
3736 $ this ->channelManager = app (ChannelManager::class);
3837
You can’t perform that action at this time.
0 commit comments