本文整理汇总了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();