5 serve(function($client) {
6 /* this might be a proxy connect or a standard request */
7 $request = new http\Message($client, false);
9 if ($request->getHeader("Proxy-Connection")) {
10 $response = new http\Env\Response;
11 $response->setEnvRequest($request);
12 $response->send($client);
14 /* soak up the request following the connect */
15 new http\Message($client, false);
18 /* return the initial message as response body */
19 $response = new http\Env\Response;
20 /* avoid OOM with $response->getBody()->append($request); */
21 $request->toStream($response->getBody()->getResource());
22 $response->send($client);