Skip to content
Permalink
Browse files
Merge pull request #719 from tarasfrompir/patch-41
Update terminals.class.php
  • Loading branch information
sergejey committed Apr 7, 2020
2 parents 54546a4 + d0af135 commit baa2e318c48a66ada786d775f40b193db07f8ab2
Showing 1 changed file with 2 additions and 0 deletions.
@@ -124,6 +124,8 @@ function getLocalIp() {
global $local_ip_address_cached;
if (isset($local_ip_address_cached)) {
$local_ip_address=$local_ip_address_cached;
} else if ($_SERVER['SERVER_ADDR'] != '127.0.0.1') {
$local_ip_address = $_SERVER['SERVER_ADDR'];
} else {
$s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_connect($s, '8.8.8.8', 53); // connecting to a UDP address doesn't send packets

0 comments on commit baa2e31

Please sign in to comment.