X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=tests%2Fproxy001.phpt;fp=tests%2Fproxy001.phpt;h=c8a2e6308dfed95a7306910e0771a6073f80c820;hb=22d8bd9cce8969e37269f1e817da0904a6af522c;hp=0000000000000000000000000000000000000000;hpb=db0ebb809983eb3dbda84dee61dfceb08feb20c3;p=m6w6%2Fext-http diff --git a/tests/proxy001.phpt b/tests/proxy001.phpt new file mode 100644 index 0000000..c8a2e63 --- /dev/null +++ b/tests/proxy001.phpt @@ -0,0 +1,48 @@ +--TEST-- +proxy - send proxy headers for a proxy request +--SKIPIF-- + +--FILE-- +setOptions(array( + "timeout" => 3, + "proxytunnel" => true, + "proxyheader" => array("Hello" => "there!"), + "proxyhost" => "localhost", + "proxyport" => $port, + )); + try { + $c->enqueue($r)->send(); + } catch (Exception $e) { + echo $e; + } + echo $c->getResponse()->getBody(); + while (!feof($pipes[1])) { + echo fgets($pipes[1]); + } + unset($r, $client); +} +?> +===DONE=== +--EXPECTF-- +Test +Server on port %d +CONNECT www.example.com:80 HTTP/1.1 +Host: www.example.com:80 +User-Agent: PECL_HTTP/%s PHP/%s libcurl/%s +Proxy-Connection: Keep-Alive +Hello: there! +Content-Length: 0 +===DONE===