6 serve(function($client) {
7 /* this might be a proxy connect or a standard request */
8 $request = new http\Message($client, false);
10 if ($request->getHeader("Proxy-Connection")) {
11 $response = new http\Env\Response;
12 $response->setEnvRequest($request);
13 $response->send($client);
15 /* soak up the request following the connect */
16 new http\Message($client, false);
19 /* return the initial message as response body */
20 $response = new http\Env\Response;
21 $response->setHeader("X-Request-Content-Length", $request->getBody()->stat("size"));
22 /* avoid OOM with $response->getBody()->append($request); */
23 dump_message($response->getBody()->getResource(), $request);
24 $response->send($client);