Added Proxy support for Api Transport (#11968)

This commit is contained in:
kleinem86
2020-07-29 16:00:55 +02:00
committed by GitHub
parent b0b62aa999
commit a4f5af069c
2 changed files with 17 additions and 0 deletions

View File

@@ -1375,6 +1375,22 @@ function set_curl_proxy($curl)
}
}
/**
* Return the proxy url in guzzle format
*
* @return 'tcp://' + $proxy
*/
function get_guzzle_proxy()
{
$proxy = get_proxy();
$tmp = rtrim($proxy, "/");
$proxy = str_replace(array("http://", "https://"), "", $tmp);
if (!empty($proxy)) {
return 'tcp://' . $proxy;
}
}
/**
* Return the proxy url
*