This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree 2 files changed +20
-1
lines changed 2 files changed +20
-1
lines changed Original file line number Diff line number Diff line change 92
92
*/
93
93
'delete_statistics_older_than_days ' => 60 ,
94
94
95
+ /*
96
+ * By default, the websockets server attempts to connect to whatever
97
+ * your APP_URL is set to. If running in a more complex environment,
98
+ * you may wish to override the base URL for internal requests to
99
+ * allow statistics to be collected.
100
+ */
101
+ 'base_url_override ' => null ,
102
+
95
103
/*
96
104
* Use an DNS resolver to make the requests to the statistics logger
97
105
* default is to resolve everything to 127.0.0.1.
Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ public function save()
79
79
$ this
80
80
->browser
81
81
->post (
82
- action ([WebSocketStatisticsEntriesController::class, ' store ' ] ),
82
+ $ this -> storeStatisticsUrl ( ),
83
83
['Content-Type ' => 'application/json ' ],
84
84
stream_for (json_encode ($ postData ))
85
85
);
@@ -88,4 +88,15 @@ public function save()
88
88
$ statistic ->reset ($ currentConnectionCount );
89
89
}
90
90
}
91
+
92
+ protected function storeStatisticsUrl (): string
93
+ {
94
+ $ action = [WebSocketStatisticsEntriesController::class, 'store ' ];
95
+
96
+ $ overridenUrl = config ('websockets.statistics.base_url_override ' );
97
+
98
+ return $ overridentUrl
99
+ ? $ overridenUrl .action ($ action , [], false )
100
+ : action ($ action );
101
+ }
91
102
}
You can’t perform that action at this time.
0 commit comments