-foreach (http\Client::getAvailableDrivers() as $driver) {
- $client = new http\Client($driver);
- $client->enqueue(new http\Client\Request("GET", "http://www.example.org"), function($response) {
- echo "R\n";
- if (!($response instanceof http\Client\Response)) {
- var_dump($response);
- }
- });
- $client->send();
-}
+server("proxy.inc", function($port) {
+ foreach (http\Client::getAvailableDrivers() as $driver) {
+ $client = new http\Client($driver);
+ $client->enqueue(new http\Client\Request("GET", "http://localhost:$port"), function($response) {
+ echo "R\n";
+ if (!($response instanceof http\Client\Response)) {
+ var_dump($response);
+ }
+ });
+ $client->send();
+ }
+});