2010-10-24 03:12:37 +04:00
|
|
|
<?php
|
2015-05-19 16:16:07 +03:00
|
|
|
|
2016-09-04 04:19:48 +03:00
|
|
|
require_once('init.php');
|
|
|
|
require_once('cmd.php');
|
2018-03-24 19:44:13 +03:00
|
|
|
require_once('DebugNone.php');
|
2016-09-04 04:19:48 +03:00
|
|
|
|
|
|
|
// handle http proxy when using file_get_contents
|
|
|
|
if (CONST_HTTP_Proxy) {
|
|
|
|
$proxy = 'tcp://' . CONST_HTTP_Proxy_Host . ':' . CONST_HTTP_Proxy_Port;
|
|
|
|
$aHeaders = array();
|
2016-09-08 04:16:22 +03:00
|
|
|
if (CONST_HTTP_Proxy_Login != null && CONST_HTTP_Proxy_Login != '' && CONST_HTTP_Proxy_Password != null && CONST_HTTP_Proxy_Password != '') {
|
2016-09-04 04:19:48 +03:00
|
|
|
$auth = base64_encode(CONST_HTTP_Proxy_Login . ':' . CONST_HTTP_Proxy_Password);
|
|
|
|
$aHeaders = array("Proxy-Authorization: Basic $auth");
|
|
|
|
}
|
|
|
|
$aContext = array(
|
2016-09-10 22:10:52 +03:00
|
|
|
'http' => array(
|
|
|
|
'proxy' => $proxy,
|
|
|
|
'request_fulluri' => true,
|
|
|
|
'header' => $aHeaders
|
|
|
|
),
|
|
|
|
'https' => array(
|
|
|
|
'proxy' => $proxy,
|
|
|
|
'request_fulluri' => true,
|
|
|
|
'header' => $aHeaders
|
|
|
|
)
|
|
|
|
);
|
2016-09-04 04:19:48 +03:00
|
|
|
stream_context_set_default($aContext);
|
|
|
|
}
|