cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: curl 7.18.1 proxy ipv6

From: Dan Fandrich <dan_at_coneharvesters.com>
Date: Thu, 31 Jul 2008 13:29:16 -0700

On Thu, Jul 31, 2008 at 05:27:40PM +0530, Pramod Sharma wrote:
> My test code
> #include "curl/curl.h"
> #include <iostream>
> int main(int argc , char *argv[])
> {
> CURL *curl = curl_easy_init();
> curl_easy_setopt(curl,CURLOPT_PORT,21);
> curl_easy_setopt(curl,CURLOPT_VERBOSE,1);
> //Proxy configuration
> curl_easy_setopt(curl,CURLOPT_PROXY,"
> [2001:db8:0:1:203:ffff:fee1:2a22]");
> curl_easy_setopt(curl,CURLOPT_PROXYPORT,80);
>
> curl_easy_setopt(curl,CURLOPT_PROXYAUTH,CURLAUTH_ANY);
> curl_easy_setopt(curl,CURLOPT_USERPWD , "pramod:root123");
> curl_easy_setopt(curl,CURLOPT_URL , "ftp://
> [2001:db8:0:1:203:ffff:fee1:2a22]:21//SiteStat.xml");
> CURLcode response = curl_easy_perform(curl);
> std::cout << curl_easy_strerror(response) << std::endl;
> }
> Curl Command line
> curl -6 -g ftp://[2001:db8:0:1:203:ffff:fee1:2a22]:21/SiteStat.xml --user
> pramod:root123 --proxy [2001:db8:0:1:203:ffff:fee1:2a22]:80
>
>
> Output from my test program :
> * About to connect() to proxy 2001:db8:0:1:203:ffff:fee1:2a22 port 80 (#0)
> * Trying 2001:db8:0:1:203:ffff:fee1:2a22... * connected
> * Connected to 2001:db8:0:1:203:ffff:fee1:2a22
> (2001:db8:0:1:203:ffff:fee1:2a22) port 80 (#0)
> * Server auth using Basic with user 'pramod'
> > GET ftp://2001:db8:0:1:203:ffff:fee1:2a22:21/SiteStat.xml HTTP/1.1

Weird--the IPv6 brackets are removed here for some reason. It turns out that
a workaround is to remove the line setting CURLOPT_PORT. Not only is port 21
the default for ftp, but it's even included in the URL. But it's still
something that should be looked at.

>>> Dan

-- 
http://www.MoveAnnouncer.com              The web change of address service
          Let webmasters know that your web site has moved
Received on 2008-07-31