yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame] | 1 | <testcase> |
| 2 | <info> |
| 3 | <keywords> |
| 4 | HTTP |
| 5 | HTTP GET |
| 6 | HTTP CONNECT |
| 7 | HTTP proxy |
| 8 | proxytunnel |
| 9 | </keywords> |
| 10 | </info> |
| 11 | |
| 12 | # |
| 13 | # Server-side |
| 14 | <reply> |
| 15 | <connect> |
| 16 | HTTP/1.1 200 Mighty fine indeed
|
| 17 | Server: test tunnel 2000
|
| 18 |
|
| 19 | </connect> |
| 20 | |
| 21 | <data nocheck="yes"> |
| 22 | HTTP/1.1 200 OK
|
| 23 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 24 | Server: test-server/fake
|
| 25 | Content-Type: text/html
|
| 26 | Funny-head: yesyes
|
| 27 | Content-Length: 9
|
| 28 | Connection: keep-alive
|
| 29 |
|
| 30 | contents |
| 31 | </data> |
| 32 | </reply> |
| 33 | |
| 34 | # |
| 35 | # Client-side |
| 36 | <client> |
| 37 | <server> |
| 38 | http |
| 39 | http-proxy |
| 40 | </server> |
| 41 | <name> |
| 42 | Suppress proxy CONNECT response headers |
| 43 | </name> |
| 44 | <command> |
| 45 | --proxytunnel --suppress-connect-headers --dump-header - --include --write-out "\nCONNECT CODE: %{http_connect}\nRECEIVED HEADER BYTE TOTAL: %{size_header}\n" --proxy %HOSTIP:%PROXYPORT http://%HOSTIP.1288:%HTTPPORT/we/want/that/page/1288 |
| 46 | </command> |
| 47 | </client> |
| 48 | |
| 49 | # |
| 50 | # Verify data after the test has been "shot" |
| 51 | <verify> |
| 52 | <strip> |
| 53 | ^User-Agent:.* |
| 54 | </strip> |
| 55 | <proxy> |
| 56 | CONNECT %HOSTIP.1288:%HTTPPORT HTTP/1.1
|
| 57 | Host: %HOSTIP.1288:%HTTPPORT
|
| 58 | Proxy-Connection: Keep-Alive
|
| 59 |
|
| 60 | </proxy> |
| 61 | <protocol> |
| 62 | GET /we/want/that/page/1288 HTTP/1.1
|
| 63 | Host: %HOSTIP.1288:%HTTPPORT
|
| 64 | Accept: */*
|
| 65 |
|
| 66 | </protocol> |
| 67 | |
| 68 | # This test is structured to test all the expectations of |
| 69 | # --suppress-connect-headers, which are: |
| 70 | # Must suppress in --include and --dump-header |
| 71 | # Must not suppress in --verbose and --trace |
| 72 | # Must not suppress in statistics (eg received header byte total) |
| 73 | <stdout> |
| 74 | HTTP/1.1 200 OK
|
| 75 | HTTP/1.1 200 OK
|
| 76 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 77 | Date: Thu, 09 Nov 2010 14:49:00 GMT
|
| 78 | Server: test-server/fake
|
| 79 | Server: test-server/fake
|
| 80 | Content-Type: text/html
|
| 81 | Content-Type: text/html
|
| 82 | Funny-head: yesyes
|
| 83 | Funny-head: yesyes
|
| 84 | Content-Length: 9
|
| 85 | Content-Length: 9
|
| 86 | Connection: keep-alive
|
| 87 | Connection: keep-alive
|
| 88 |
|
| 89 |
|
| 90 | contents |
| 91 | |
| 92 | CONNECT CODE: 200 |
| 93 | RECEIVED HEADER BYTE TOTAL: 231 |
| 94 | </stdout> |
| 95 | </verify> |
| 96 | </testcase> |