admiral_grinder has asked for the wisdom of the Perl Monks concerning the following question:
I have stumbled upon a interesting problem in our application. When testing our app in a Linux VM that is unable to get a IPv4 address, LWP fails to connect to localhost. This app has the webserver running and Firefox is able to connect to it fine.
The VM: Stock CentOS 6.4 Desktop in Virtual Box on Corporate Win 7 with the following network adapters:
When I bring up a network that has a IPv4 connection, it magically starts working. I take it down and LWP stops working. However, Firefox happily works anyways. Then when I take down all eth interfaces, it works again.
Here is the boiled down test script:
We have had a few people look into this and it has us stumped. All the system tools for networking still work for us.#!perl -w use strict; use LWP; my $browser = LWP::UserAgent->new(); my $response = $browser->get("http://localhost:8080/index.html"); if($response->is_success()) { print "Success\n"; } else { print "Failure\n"; } print "Response: ".$response->as_string();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP connecting to LWP issue when no eth has ipv4 address
by choroba (Cardinal) on Jul 08, 2015 at 21:15 UTC | |
by admiral_grinder (Pilgrim) on Jul 09, 2015 at 13:35 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |