2 proxy - send proxy headers for a proxy request
11 include "helper/server.inc";
15 server("proxy.inc", function($port, $stdin, $stdout, $stderr) {
16 echo "Server on port $port\n";
19 $r = new http\Client\Request("GET", "http://www.example.com/");
22 "proxytunnel" => true,
23 "proxyheader" => array("Hello" => "there!"),
24 "proxyhost" => "localhost",
28 $c->enqueue($r)->send();
29 } catch (Exception $e) {
32 echo $c->getResponse()->getBody();
41 CONNECT www.example.com:80 HTTP/1.1
42 Host: www.example.com:80
43 User-Agent: PECL_HTTP/%s PHP/%s libcurl/%s
44 Proxy-Connection: Keep-Alive