reduce count of online tests
[m6w6/ext-http] / tests / proxy.inc
1 <?php
2
3 include "server.inc";
4
5 serve(function($client) {
6 /* this might be a proxy connect or a standard request */
7 $request = new http\Message($client, false);
8
9 if ($request->getHeader("Proxy-Connection")) {
10 $response = new http\Env\Response;
11 $response->send($client);
12
13 /* soak up the request following the connect */
14 new http\Message($client, false);
15 }
16
17 /* return the initial message as response body */
18 $response = new http\Env\Response;
19 $response->getBody()->append($request);
20 $response->send($client);
21 });