Live Helper Chat support forum.. Forum is locked. New place for questions - Github Discussions
You are not logged in.
Hello friend,
After the some update in mid - year 2017, LiveHelperChat stopped showing IP of visitors. Displays only 127.0.0.1 for each visitor.
I think I have everything allowed everywhere.
Does anyone have any experience with this problem?
Thank you for every answer.
Offline
Here all works. I don't have this problem...
Offline
Thanks for reply.
So should I try a total reinstall?
Offline
I dot not think it would help. Try to write some script to check where is a problem...
Offline
I don't know how to test it by skript, I'm not a programmer :-(
Offline
Well, not much I can do... Without having to login to server etc etc...
you can modify index.php and put under <?php
print_r($_SERVER);
And paste content there...
Offline
Hi Remdex,
I found something.
It worked last on PHP 5.6.40.
It stopped working on PHP 7.0.33 web hosting after migration.
I tried a new installation of LiveHelperChat on PHP 7.0.33 but still the same result.
All visitors have IP: 127.0.0.1
Is it possible to do something about it?
Is there a problem with the new PHP features?
Offline
Here is the command response: print_r($_SERVER);
Explanation:
***** = It is anonymized private data
ECHO:
Array ( [HTTPS] => on [UNIQUE_ID] => ***
[PERL5LIB] => /usr/share/awstats/lib:/usr/share/awstats/plugins
[HTTP_HOST] => www.********.com [HTTP_X_REAL_IP] => 109.80.146.135
[HTTP_X_FORWARDED_PROTO] => https [HTTP_CONNECTION] => close [HTTP_CACHE_CONTROL] => max-age=0 [HTTP_UPGRADE_INSECURE_REQUESTS] => 1 [HTTP_USER_AGENT] => Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36 OPR/60.0.3255.170 [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 [HTTP_ACCEPT_ENCODING] => gzip, deflate, br [HTTP_ACCEPT_LANGUAGE] => cs-CZ,cs;q=0.9 [HTTP_COOKIE] => _ga=GA1.2.717662616.1560057882; _gid=GA1.2.391026245.1596859933; PHPSESSID=88h22e08tvk29r39ne7tmu8u6m95rt0l; lhc_rm_u=uw0mpu2kpxyl6uzy23xdxvb5785gy%3A3%3A38a337704d3111bb546e8563e9ba64efe1332ede; lhc_per={%22vid%22:%22e10b717bace0fa84847d%22%2C%22hnh%22:%221596882085%22%2C%22ex%22:15979%2C%22lhc_hnh%22:%221597034792%22}; lhc_ses={%22hash_resume%22:%226_4e912c3439a34c9dd528e02491b3b7f210434797%22} [HTTP_X_FORWARDED_FOR] => 127.0.0.1 [PATH] => /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin [SERVER_SIGNATURE] => [SERVER_SOFTWARE] => Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04
[SERVER_NAME] => www.******.com [SERVER_ADDR] => 127.0.0.2 [SERVER_PORT] => 80 [REMOTE_ADDR] => 109.80.146.135
[DOCUMENT_ROOT] => /home/*****.com/*****.com
[REQUEST_SCHEME] => http [CONTEXT_PREFIX] => [CONTEXT_DOCUMENT_ROOT] => /home/*****.com/*****.com
[SERVER_ADMIN] => *********.com [SCRIPT_FILENAME] => /home/*****.com/*****.com/test_ip.php
[REMOTE_PORT] => 46879 [GATEWAY_INTERFACE] => CGI/1.1 [SERVER_PROTOCOL] => HTTP/1.1 [REQUEST_METHOD] => GET [QUERY_STRING] => [REQUEST_URI] => /test_ip.php [SCRIPT_NAME] => /test_ip.php [PHP_SELF] => /test_ip.php [REQUEST_TIME_FLOAT] => 1596949578.761 [REQUEST_TIME] => 1596949578 )
Offline
Sorry, but I just can't reproduce. But what I see is incorrect values from your hosting...
[HTTP_X_FORWARDED_FOR] = Should be real IP now it's 127.0.0.1
[REMOTE_ADDR] = 109.80.146.135 Real IP
And as of HTTP_X_FORWARDED_FOR always has higher priority. Please FIX your server configuration or tell your hosting that real IP should be in HTTP_X_FORWARDED_FOR this field...
Offline
Thank you so much for help :-)
I will try to contact the web hosting provider.
Offline
Hi Remdex,
unfortunately, the situation cannot be solved.
Web hosting has a new security.
Is it possible to bypass this security in the next LiveHelperChat update?
I am sending you his statement.
Citation of technicial support:
************************************************************************
Good day,
this is due to the predominance of Nginx over Apache, this change occurred to maintain the stability of shared web hosts. Overriding x-forwarded-for with mod_remote_ip is automatically overridden to REMOTE_ADDR. This is a feature of shared hosting and I can't help you.
Thank you
Webmaster
Offline
Hi,
That's incorrect workflow they are doing.
You can modify this function and just after "public static function getIP(){"
return $_SERVER["REMOTE_ADDR"];
Offline
Hi Remdex,
thank you for support. I replaced the getIP function. I found this alternative solution. It may be incorrect, but it works:
// Original to /* */
/* public static function getIP(){
if (self::$couldflareRun == false){
self::cloudflareInit();
self::$couldflareRun = true;
}
if ( isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '' ) {
$_SERVER['REMOTE_ADDR'] = str_replace(' ', '', $_SERVER['HTTP_X_FORWARDED_FOR']);
$parts = explode(',', $_SERVER['REMOTE_ADDR']);
$_SERVER['REMOTE_ADDR'] = $parts[0];
}
$_SERVER['REMOTE_ADDR'] = isset($_SERVER['REMOTE_ADDR']) ? strip_tags($_SERVER['REMOTE_ADDR']) : '127.0.0.1';
return $_SERVER["REMOTE_ADDR"];
} */
// Modification - show real IP
public static function getIp(): string
{
$ip = null;
if (isset($_SERVER['REMOTE_ADDR'])) {
$ip = filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
}
return is_string($ip) ? $ip : '127.0.0.1';
}
Offline