Welcome! Log In Create A New Profile

Advanced

How to log the number of bytes sent over a websocket?

June 22, 2018 09:40AM
Hi All,

I am using nginx as a websocket reverse-proxy (this is working fine
BTW). I would like to log the number of bytes sent (and ideally also
received) over a websocket. If I use `$body_bytes_sent` in `log_format`,
the entry in the access_log is always 0. As far as I can tell, a lot of
data went through the websocket, so clearly `$body_bytes_sent` does not
include data sent over a websocket.

I tried to use `$bytes_sent`, but it's just one or two hundred bytes (no
matter how much data is sent over the websocket), so that's clearly just
the HTTP headers. I went through the list of available nginx variables,
but I couldn't find anything for me...

Any idea?

Thanks a lot for any help!

  Fabrice

_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

How to log the number of bytes sent over a websocket?

seekr June 22, 2018 09:40AM

Re: How to log the number of bytes sent over a websocket?

Sergey Kandaurov June 25, 2018 08:16AM

Re: How to log the number of bytes sent over a websocket?

seekr June 25, 2018 08:34AM

Re: How to log the number of bytes sent over a websocket?

seekr June 26, 2018 05:54AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 175
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready