• Resolved BE API

    (@beapi)


    Hello,

    When using a reverse proxy, we’ve noticed that its IP is logged in Stream (instead of the user’s real IP).
    The WP-Cerber plugin has an option to consider this and obtain the user’s real IP.
    Is this something you could consider implementing in Stream?

    Regards,

Viewing 1 replies (of 1 total)
  • Plugin Author Bartosz Gadomski

    (@bartoszgadomski)

    Hi, thanks for reaching out!

    Currently we use REMOTE_ADDR server variable to get the user IP (see: https://github.com/xwp/stream/blob/b3cd8377515e10d2a61b1ee3fbec3983d47d3a37/classes/class-plugin.php#L175-L176), however – as you noticed – with reverse proxy in place this variable is not providing the real user’s IP address.

    While we’re not working on a fix for this right now, there’s a wp_stream_client_ip_address filter available which you can use to adjust the IP address value with a little bit of custom code. For example:

    add_filter( 'wp_stream_client_ip_address', function ( $ip_address ) {
    return $_SERVER['X-Forwarded-For']; // Adjust to get the real user IP.
    } );

    Hope that helps!

Viewing 1 replies (of 1 total)

The topic ‘Reverse proxy and real IP’ is closed to new replies.