comparison proxy.t @ 434:a8596c7b33cc

Tests: style.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 11 Jul 2014 17:37:38 +0400
parents c1269426585d
children 3b6ff3b7367d
comparison
equal deleted inserted replaced
433:4a045c74a77c 434:a8596c7b33cc
41 41
42 location / { 42 location / {
43 proxy_pass http://127.0.0.1:8081; 43 proxy_pass http://127.0.0.1:8081;
44 proxy_read_timeout 1s; 44 proxy_read_timeout 1s;
45 } 45 }
46
46 location /var { 47 location /var {
47 proxy_pass http://$arg_ip:$arg_port/; 48 proxy_pass http://$arg_b;
49 proxy_read_timeout 1s;
48 } 50 }
49 } 51 }
50 } 52 }
51 53
52 EOF 54 EOF
59 like(http_get('/'), qr/SEE-THIS/, 'proxy request'); 61 like(http_get('/'), qr/SEE-THIS/, 'proxy request');
60 like(http_get('/multi'), qr/AND-THIS/, 'proxy request with multiple packets'); 62 like(http_get('/multi'), qr/AND-THIS/, 'proxy request with multiple packets');
61 63
62 unlike(http_head('/'), qr/SEE-THIS/, 'proxy head request'); 64 unlike(http_head('/'), qr/SEE-THIS/, 'proxy head request');
63 65
64 like(http_get('/var?ip=127.0.0.1&port=8081'), qr/SEE-THIS/, 66 like(http_get('/var?b=127.0.0.1:8081/'), qr/SEE-THIS/, 'proxy with variables');
65 'proxy url with IP literal and variable');
66 67
67 ############################################################################### 68 ###############################################################################
68 69
69 sub http_daemon { 70 sub http_daemon {
70 my $server = IO::Socket::INET->new( 71 my $server = IO::Socket::INET->new(