cURL / Mailing Lists / curl-users / Single Mail

curl-users

Re: is --interface or CURLOPT_INTERFACE bugged?

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Mon, 28 Feb 2011 11:13:35 -0800

On Sat, Feb 26, 2011 at 04:16:55PM -0800, Bryan Schaefer wrote:
> However, when i try either of the following:
>
> curl --interface eth0 http://freedns.afraid.org (or any interface, or an IP of
> any interface)
>
> or
>
> my $curl = WWW::Curl::Easy->new;
> $curl->setopt(CURLOPT_INTERFACE, 'eth0');
> $curl->setopt(CURLOPT_URL, 'http://freedns.afraid.org');
> $output = $curl->perform;
> print $output;
>
> it times out, returning code 7, could not connect to host.
>
> Am I doing something wrong, or is the interface option wrong?

This is most easily explained by eth0 not being the correct interface to
use :-) But you're using --interface correctly, so there must be something
going on. What does the -v option show? Does "ping -I eth0 freedns.afraid.org"
work?

>>> Dan
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-users
FAQ: http://curl.haxx.se/docs/faq.html
Etiquette: http://curl.haxx.se/mail/etiquette.html
Received on 2011-02-28