Tests: use 127.0.0.1 instead of localhost.

Name 'localhost' is ambiguous if ipv6 present on system.
diff --git a/fastcgi.t b/fastcgi.t
index dc21574..889d10e 100644
--- a/fastcgi.t
+++ b/fastcgi.t
@@ -42,7 +42,7 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
@@ -75,7 +75,7 @@
 	while( $request->Accept() >= 0 ) {
 		$count++;
 		print <<EOF;
-Location: http://localhost:8080/redirect
+Location: http://127.0.0.1:8080/redirect
 Content-Type: text/html
 
 SEE-THIS
diff --git a/lib/Test/Nginx.pm b/lib/Test/Nginx.pm
index d5df67f..e386949 100644
--- a/lib/Test/Nginx.pm
+++ b/lib/Test/Nginx.pm
@@ -212,7 +212,7 @@
 		alarm(2);
 		my $s = IO::Socket::INET->new(
 			Proto => 'tcp',
-			PeerHost => 'localhost:8080'
+			PeerAddr => '127.0.0.1:8080'
 		);
 		log_out($request);
 		$s->print($request);
diff --git a/lib/Test/Nginx/SMTP.pm b/lib/Test/Nginx/SMTP.pm
index b3c132d..44c8eee 100644
--- a/lib/Test/Nginx/SMTP.pm
+++ b/lib/Test/Nginx/SMTP.pm
@@ -22,8 +22,7 @@
 
 	my $self = return $class->SUPER::new(
 		Proto => "tcp",
-		PeerAddr => "localhost",
-		PeerPort => 8025,
+		PeerAddr => "127.0.0.1:8025",
 		@_
 	)
 		or die "Can't connect to nginx: $!\n";
diff --git a/memcached.t b/memcached.t
index de601ff..4f3d280 100644
--- a/memcached.t
+++ b/memcached.t
@@ -42,7 +42,7 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
diff --git a/proxy-noclose.t b/proxy-noclose.t
index 1a17549..fd72595 100644
--- a/proxy-noclose.t
+++ b/proxy-noclose.t
@@ -52,16 +52,16 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
         }
 
         location /uselen {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
 
             # test will wait only 2s for reply, we it will fail if
             # Content-Length not used as a hint
diff --git a/proxy.t b/proxy.t
index 4e53708..842b1eb 100644
--- a/proxy.t
+++ b/proxy.t
@@ -41,11 +41,11 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location / {
-            proxy_pass http://localhost:8081;
+            proxy_pass http://127.0.0.1:8081;
             proxy_read_timeout 1s;
         }
     }
diff --git a/range-flv.t b/range-flv.t
index 5190bc0..622b683 100644
--- a/range-flv.t
+++ b/range-flv.t
@@ -41,7 +41,7 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
         location / {
             flv;
diff --git a/range.t b/range.t
index edc2123..5029744 100644
--- a/range.t
+++ b/range.t
@@ -45,7 +45,7 @@
     }
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location /t2.html {
diff --git a/smtp-greeting-delay.t b/smtp-greeting-delay.t
index eccc9c2..4ed5b68 100644
--- a/smtp-greeting-delay.t
+++ b/smtp-greeting-delay.t
@@ -32,11 +32,11 @@
 
 mail {
     proxy_pass_error_message  on;
-    auth_http  http://localhost:8080/mail/auth;
+    auth_http  http://127.0.0.1:8080/mail/auth;
     xclient    off;
 
     server {
-        listen     localhost:8025;
+        listen     127.0.0.1:8025;
         protocol   smtp;
         smtp_greeting_delay  100ms;
     }
diff --git a/smtp.t b/smtp.t
index a66fcdc..20bf926 100644
--- a/smtp.t
+++ b/smtp.t
@@ -39,11 +39,11 @@
 
 mail {
     proxy_pass_error_message  on;
-    auth_http  http://localhost:8080/mail/auth;
+    auth_http  http://127.0.0.1:8080/mail/auth;
     xclient    off;
 
     server {
-        listen     localhost:8025;
+        listen     127.0.0.1:8025;
         protocol   smtp;
         smtp_auth  login plain none;
     }
@@ -57,7 +57,7 @@
     proxy_temp_path        %%TESTDIR%%/proxy_temp;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location = /mail/auth {
diff --git a/ssi-include-big.t b/ssi-include-big.t
index 50f8066..1123038 100644
--- a/ssi-include-big.t
+++ b/ssi-include-big.t
@@ -45,11 +45,11 @@
     gzip on;
 
     server {
-        listen       localhost:8080;
+        listen       127.0.0.1:8080;
         server_name  localhost;
 
         location /proxy/ {
-            proxy_pass http://localhost:8080/local/;
+            proxy_pass http://127.0.0.1:8080/local/;
         }
         location = /local/blah {
             return 204;