本文整理匯總了PHP中Proxy::getProxy方法的典型用法代碼示例。如果您正苦於以下問題:PHP Proxy::getProxy方法的具體用法?PHP Proxy::getProxy怎麽用?PHP Proxy::getProxy使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Proxy
的用法示例。
在下文中一共展示了Proxy::getProxy方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getProxy
function getProxy()
{
if (!empty($_GET['radomProxy'])) {
require __DIR__ . '/library/getProxy.php';
$hoge = new Proxy();
$hoge->setRandomProxyAndPort();
$proxy = $hoge->getProxy() . ":" . $hoge->getPort();
return $proxy;
} else {
return false;
}
}
示例2: setOptionProxy
protected function setOptionProxy(&$descriptor)
{
if (is_object($this->proxy)) {
$proxy = $this->proxy->getProxy($descriptor['descriptor_key'], $descriptor['option'][CURLOPT_URL]);
if (is_string($proxy['proxy']) && DryPath::isIp($proxy['proxy'])) {
$this->setOption($descriptor, CURLOPT_PROXY, $proxy['proxy']);
} else {
$descriptor['option'][CURLOPT_URL] = false;
}
} elseif (is_string($this->proxy)) {
$this->setOption($descriptor, CURLOPT_PROXY, $this->proxy);
}
}
示例3: main
public static function main(array $args = array())
{
$location = array("localhost:10000", "localhost:10000", "localhost:10000");
$monitor = array();
for ($i = 0; $i < count($location); $i++) {
$machine = Proxy::getProxy($location[$i]);
$monitor[$i] = new GumballMonitor($machine);
println($monitor[$i]);
}
for ($i = 0; $i < count($monitor); $i++) {
$monitor[$i]->report();
}
}
示例4: println
<?php
require_once "../../../bootstrap.php";
require_once "custom/Proxy.php";
$args = $_SERVER["argv"];
println("Stopping server " . $args[0]);
$proxy = Proxy::getProxy($args[0]);
$proxy->shutdown();