2 proxy - don't send proxy headers for a standard request
13 $spec = array(array("pipe","r"), array("pipe","w"), array("pipe","w"));
14 if (($proc = proc_open(PHP_BINARY . " proxy.inc", $spec, $pipes, __DIR__))) {
15 $port = trim(fgets($pipes[2]));
16 echo "Server on port $port\n";
18 $r = new http\Client\Request("GET", "http://localhost:$port/");
21 "proxyheader" => array("Hello" => "there!"),
24 $c->enqueue($r)->send();
25 } catch (Exception $e) {
28 echo $c->getResponse()->getBody();
29 while (!feof($pipes[1])) {
30 echo fgets($pipes[1]);
40 User-Agent: PECL_HTTP/%s PHP/%s libcurl/%s