This repository was archived by the owner on Feb 7, 2024. It is now read-only.
File tree 2 files changed +22
-1
lines changed
2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 80
80
*/
81
81
'delete_statistics_older_than_days ' => 60 ,
82
82
83
+ /*
84
+ * By default, the websockets server attempts to connect to whatever
85
+ * your APP_URL is set to. If running in a more complex environment,
86
+ * you may wish to override the base URL for internal requests to
87
+ * allow statistics to be collected.
88
+ */
89
+ 'base_url_override ' => null ,
90
+
83
91
/*
84
92
* Use an DNS resolver to make the requests to the statistics logger
85
93
* default is to resolve everything to 127.0.0.1.
Original file line number Diff line number Diff line change @@ -65,6 +65,19 @@ protected function findOrMakeStatisticForAppId($appId): Statistic
65
65
return $ this ->statistics [$ appId ];
66
66
}
67
67
68
+ protected function getUrl (): string
69
+ {
70
+ $ action = [WebSocketStatisticsEntriesController::class, 'store ' ];
71
+
72
+ $ url_override = config ('websockets.statistics.base_url_override ' , null );
73
+
74
+ if ($ url_override !== null ) {
75
+ return $ url_override .action ($ action , [], false );
76
+ }
77
+
78
+ return action ($ action );
79
+ }
80
+
68
81
public function save ()
69
82
{
70
83
foreach ($ this ->statistics as $ appId => $ statistic ) {
@@ -79,7 +92,7 @@ public function save()
79
92
$ this
80
93
->browser
81
94
->post (
82
- action ([WebSocketStatisticsEntriesController::class, ' store ' ] ),
95
+ $ this -> getUrl ( ),
83
96
['Content-Type ' => 'application/json ' ],
84
97
stream_for (json_encode ($ postData ))
85
98
);
You can’t perform that action at this time.
0 commit comments