pikvm / ustreamer

µStreamer - Lightweight and fast MJPEG-HTTP streamer
https://pikvm.org
GNU General Public License v3.0
1.74k stars 240 forks source link

Syslog Entry for Connected/Disconnected Clients #100

Closed jdolence999 closed 3 years ago

jdolence999 commented 3 years ago

Presently ustreamer creates a syslog entry for connected and disconnected clients such as the one below for a connection:

ustreamer[4330]: -- INFO [194149.051 http] -- HTTP: Registered client: [127.0.0.1]:41242, id=7740de1d7d0b8a8f; clients now: 1

I am running ustreamer on the local host as seen in the log entry. I have a couple of programs that act as a reverse proxy for client connections but all client connections will log with the localhost IP address. I'd like to request a modification for the ustreamer code to look for a pre-defined header such as the industry standard x-forwarded-for or a user defined header value (e.g. true-client-ip, actual-ip, etc.) and use the associated IP address in the log entry? if no header exists, ustreamer should log the connecting source ip as it does today.

mdevaev commented 3 years ago

Okay, I'll do it.

mdevaev commented 3 years ago

Done.

jdolence999 commented 3 years ago

Awesome! Thanks! I'll check it out as soon as I get a chance!