Laravel-websockets: Statistics not inserted into database table

Created on 1 May 2019  路  5Comments  路  Source: beyondcode/laravel-websockets

I did re-install this package several times. when I was trying to learn that. So, I had more of one websockets_statistics_entries migration and I deleted more migrations manually and ran composer dump-autoload ant etc.

Now my realtime statistics works fine, but my statistics do not insert into my table.

Does anyone know why is that?

Most helpful comment

Thanks for your respone.

        'perform_dns_lookup' => '127.0.0.1',

did solve my probblem.

All 5 comments

The stats get inserted by doing an HTTP request to your main app at 127.0.0.1 (localhost) by default. If your websocket server can't reach that, the stats don't get recorded.

See this config option https://github.com/beyondcode/laravel-websockets/blob/master/config/websockets.php#L87 which will use your APP_URL config to connect to your app over HTTP. If your app needs a different URL than your .env APP_URL, then you'll need to wait until https://github.com/beyondcode/laravel-websockets/pull/115 is merged to add support for that.

Thanks for your respone.

        'perform_dns_lookup' => '127.0.0.1',

did solve my probblem.

@francislavoie So I have the problem that my statistic is not recorded as well when I use the subdomain nginx method.

For example:

staging.mydomain.com communications with socket.mydomain.com

Even though I fire messages etc all the time and two users are connected, I don't see it reflected in the database websockets_statistics_entries.

Is base_url_override going to help me?

I'm not certain but it should be easy for you to try - either make the change in-place in your vendor to test it, or make a fork and add the change to that, and target that dependency in composer instead. Hope you figure it out!

@francislavoie Oh you were fast responding. Thanks! I'm going to try it out. Currently, I changed my server to "Same location for websockets and web contents", but still no luck. (Cleared chache and restarted supervision). Trying the fork out.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

henzeb picture henzeb  路  4Comments

myckhel picture myckhel  路  3Comments

rikless picture rikless  路  4Comments

ElegantSoft picture ElegantSoft  路  3Comments

vesper8 picture vesper8  路  3Comments