args-http-head-get.pl revision 1.1
1use strict; 2use warnings; 3 4my $payload_len = 64; 5our %args = ( 6 client => { 7 func => sub { 8 my $self = shift; 9 my @request_stream = split("\n", <<"EOF", -1); 10HEAD http://foo.bar/$payload_len HTTP/1.1 11 12EOF 13 pop @request_stream; 14 print map { "$_\r\n" } @request_stream; 15 print STDERR map { ">>> $_\n" } @request_stream; 16 $self->{method} = 'HEAD'; 17 http_response($self, $payload_len); 18 @request_stream = split("\n", <<"EOF", -1); 19GET http://foo.bar/$payload_len HTTP/1.1 20 21EOF 22 pop @request_stream; 23 print map { "$_\r\n" } @request_stream; 24 print STDERR map { ">>> $_\n" } @request_stream; 25 $self->{method} = 'GET'; 26 http_response($self, $payload_len); 27 }, 28 http_vers => ["1.1"], 29 nocheck => 1, 30 }, 31 relayd => { 32 protocol => [ "http", 33 "match request path log \"*\"", 34 ], 35 loggrep => { 36 qr/, done, \[http:\/\/foo.bar\/$payload_len\] HEAD; \[http:\/\/foo.bar\/$payload_len\] GET/ => 1, 37 }, 38 }, 39 server => { 40 func => \&http_server, 41 nocheck => 1, 42 }, 43); 44 451; 46