Welcome, Guest. Please login or register.

Author Topic: Accessing to weather information behind a proxy  (Read 1413 times)

richard.lajaunie

  • Newbie
  • *
  • Posts: 26
    • View Profile
Accessing to weather information behind a proxy
« on: February 05, 2014, 01:04:10 PM »
hi,
When nedi is behind a proxy, In the topology-table page when you click on the icon Weather nothing appen.
After some research, i've found that the function file_get_content try to access directly to weather server.
to correct this problem, i've made some change in the libmon.php file.

I changed all «file_get_contents» to «file_get_Content» with the command «sed -i s/file_get_contents/file_get_Content/ libmon.php»
and i add the following function:
Code: [Select]
function file_get_Content($url){
        $aContext = array(
            'http' => array(
                'proxy' => 'tcp://10.10.10.10:9999',
                'request_fulluri' => true,
            ),
        );
        $cxContext = stream_context_create($aContext);

        $sFile = file_get_contents($url, False, $cxContext);

        return $sFile;
}

Of course this just a workarround and this must correctly integrate with nedi.conf

Bye
Richard

rickli

  • Administrator
  • Hero Member
  • *****
  • Posts: 2701
    • View Profile
    • NeDi
Re: Accessing to weather information behind a proxy
« Reply #1 on: February 06, 2014, 07:05:54 PM »
Good one, tx!
Please consider Other-Invoices on your NeDi installation for an annual contribution, tx!
-Remo