This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree 3 files changed +21
-4
lines changed
3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change 141
141
142
142
],
143
143
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
+
144
162
/*
145
163
|--------------------------------------------------------------------------
146
164
| Broadcasting Replication PubSub
147
165
|--------------------------------------------------------------------------
148
166
|
149
167
| You can enable replication to publish and subscribe to
150
168
| messages across the driver.
151
-
169
+ |
152
170
| By default, it is set to 'local', but you can configure it to use drivers
153
171
| like Redis to ensure connection between multiple instances of
154
172
| 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
34
34
35
35
public function echo ()
36
36
{
37
- $ this ->get ('/app/{appKey} ' , WebSocketHandler::class);
37
+ $ this ->get ('/app/{appKey} ' , config ( ' websockets.handlers.websocket ' , WebSocketHandler::class) );
38
38
39
39
$ this ->post ('/apps/{appId}/events ' , TriggerEventController::class);
40
40
$ this ->get ('/apps/{appId}/channels ' , FetchChannelsController::class);
Original file line number Diff line number Diff line change 10
10
use BeyondCode \LaravelWebSockets \Tests \Mocks \Message ;
11
11
use BeyondCode \LaravelWebSockets \Tests \Statistics \Logger \FakeStatisticsLogger ;
12
12
use BeyondCode \LaravelWebSockets \WebSockets \Channels \ChannelManager ;
13
- use BeyondCode \LaravelWebSockets \WebSockets \WebSocketHandler ;
14
13
use Clue \React \Buzz \Browser ;
15
14
use GuzzleHttp \Psr7 \Request ;
16
15
use Mockery ;
@@ -32,7 +31,7 @@ public function setUp(): void
32
31
{
33
32
parent ::setUp ();
34
33
35
- $ this ->pusherServer = app (WebSocketHandler::class );
34
+ $ this ->pusherServer = app (config ( ' websockets.handlers.websocket ' ) );
36
35
37
36
$ this ->channelManager = app (ChannelManager::class);
38
37
You can’t perform that action at this time.
0 commit comments