[LAC-TF] URL literals

Guillermo Cotone guillermo.cotone at gmail.com
Sat Mar 5 02:01:27 BRT 2011


Arturo,

Tienes que usar el flag "-g" al usar "[]" o "{}".

$ curl --version
curl 7.21.3 (amd64-portbld-freebsd8.0) libcurl/7.21.3 OpenSSL/0.9.8q
zlib/1.2.3
Protocols: dict file ftp ftps gopher http https imap imaps pop3 pop3s rtsp
smtp smtps telnet tftp
Features: IPv6 Largefile NTLM SSL libz
$
$ curl  http://[2620:0:1cfe:face:b00c::3]/
curl: (3) [globbing] error: bad range specification after pos 9
$
$ curl -gv http://[2620:0:1cfe:face:b00c::3]/
* About to connect() to 2620:0:1cfe:face:b00c::3 port 80 (#0)
*   Trying 2620:0:1cfe:face:b00c::3... connected
* Connected to 2620:0:1cfe:face:b00c::3 (2620:0:1cfe:face:b00c::3) port 80
(#0)
> GET / HTTP/1.1
> User-Agent: curl/7.21.3 (amd64-portbld-freebsd8.0) libcurl/7.21.3
OpenSSL/0.9.8q zlib/1.2.3
> Host: [2620:0:1cfe:face:b00c::3]
> Accept: */*
>
< HTTP/1.1 302 Found
< Location: http://
[2620:0:1cfe:face:b00c::3]/?refsrc=http%3A%2F%2F%5B2620%2F&_rdr
< P3P: CP="Facebook does not have a P3P policy. Learn why here:
http://fb.me/p3p"
< Set-Cookie: datr=hMNxTSD8Gh5iDgUxEe_FT6wc; expires=Mon, 04-Mar-2013
05:00:52 GMT; path=/; domain=.facebook.com; httponly
< Set-Cookie: locale=en_US; expires=Sat, 12-Mar-2011 05:00:52 GMT; path=/;
domain=.facebook.com
< Content-Type: text/html; charset=utf-8
< X-Powered-By: HPHP
< X-FB-Server: 10.43.78.59
< Connection: close
< Date: Sat, 05 Mar 2011 05:00:52 GMT
< Content-Length: 0
<
* Closing connection #0

Tambien lo he probado en un Debian sin problemas.
Slds.

El 4 de marzo de 2011 21:29, Arturo Servin <aservin at lacnic.net> escribió:

> Guillermo,
>
> De hecho mi primer intento fue entre "[" y "]" sin éxito.
>
> De hecho volví a probar tu ejemplo de:
>
>  curl -g http://[2620:0:1cfe:face:b00c::3]/
>
> Y me envía un error de "not match" o "curl: (3) [globbing] error: bad range
> specification after pos 9" (linux y freeBSD respectivamente).
>
> Slds,
> .as
>
> On 4 Mar 2011, at 21:23, Guillermo Cotone wrote:
>
> Arturo,
> Curl siempre interpreta el ultimo numero luego de ":" como el puerto de
> conexion. Si este numero es hexadecimal, automaticamente identifica que se
> trata de una direccion IPv6.
> Para delimitar el inicio y fin de una direccion IPv6 comunmente se utilizan
> los parentesis. Ej:
> $ curl -g http://
>
> El 4 de marzo de 2011 17:42, Arturo Servin <aservin at lacnic.net> escribió:
>
>>
>>        Creo que encontré el por qué. Curl no interpreta bien la dirección
>> de IPv6 por alguna razón.
>>
>>        Tratando:
>>
>>        curl -v http://2001:13c7:7002:4::10
>>
>>        no funciona.
>>
>>        Sin embargo curl -v http://2001:13c7:7002:4::10:80 (con el puerto
>> 80 funciona bien)
>>
>>        Igual, extendiendo la IP tampoco ayuda:
>> 2001:13c7:7002:4000:0000:0000:0000:10
>>
>>
>> Gracias,
>> .as
>>
>> On 4 Mar 2011, at 16:53, Hugo Salgado wrote:
>>
>> > A mi me funciona:
>> >
>> > $ curl -v http://2001:610:240:22::c100:68b
>> > * About to connect() to 2001:610:240:22::c100:68b port 80 (#0)
>> > *   Trying 2001:610:240:22::c100:68b... connected
>> > * Connected to 2001:610:240:22::c100:68b (2001:610:240:22::c100:68b)
>> > port 80 (#0)
>> >> GET / HTTP/1.1
>> >> User-Agent: curl/7.21.0 (x86_64-redhat-linux-gnu) libcurl/7.21.0
>> > NSS/3.12.8.0 zlib/1.2.5 libidn/1.18 libssh2/1.2.4
>> >> Host: 2001:610:240:22::c100:68b
>> >> Accept: */*
>> >>
>> > < HTTP/1.1 302 Found
>> > < Date: Fri, 04 Mar 2011 18:51:43 GMT
>> > < Server: Apache/2.2.3 (CentOS)
>> > < Location: http://www.ripe.net/
>> > < Content-Length: 294
>> > < Connection: close
>> > < Content-Type: text/html; charset=iso-8859-1
>> > <
>> > <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
>> > <html><head>
>> > <title>302 Found</title>
>> > </head><body>
>> > <h1>Found</h1>
>> > <p>The document has moved <a href="http://www.ripe.net/">here</a>.</p>
>> > <hr>
>> > <address>Apache/2.2.3 (CentOS) Server at 2001:610:240:22::c100:68b Port
>> > 80</address>
>> > </body></html>
>> > * Closing connection #0
>> >
>> > $ curl -V
>> > curl 7.21.0 (x86_64-redhat-linux-gnu) libcurl/7.21.0 NSS/3.12.8.0
>> > zlib/1.2.5 libidn/1.18 libssh2/1.2.4
>> > Protocols: dict file ftp ftps http https imap imaps ldap ldaps pop3
>> > pop3s rtsp scp sftp smtp smtps telnet tftp
>> > Features: AsynchDNS GSS-Negotiate IDN IPv6 Largefile NTLM SSL libz
>> >
>> >
>> > Saludos,
>> >
>> > Hugo
>> >
>> > On 03/04/2011 03:31 PM, Arturo Servin wrote:
>> >>
>> >>      Alguien sabe como usar curl con una IP (literal) en v6?
>> >>
>> >>      He probado varias formas y ninguna funciona:
>> >>
>> >> curl 2001:13c7:7002:4000::10
>> >> curl http://[2001:13c7:7002:4000::10]
>> >> curl [2001:13c7:7002:4000::10]
>> >>
>> >>      Accediendo por nombre no hay problema con -6 como bandera pero
>> quiero probar un sitio sin AAAA.
>> >>
>> >>      Lo mismo si alguien sabe como usar literales en v6 con urllib
>> (python). Igual probé varios métodos y no funciona (al igual que curl, trata
>> de resolver a un nombre de DNS).
>> >>
>> >>      Wget y varios navegadores funcionan de acuerdo al RFC2732 pero
>> curl y urllib parecen no hacerlo y quería saber si alguien conoce algún
>> truco.
>> >>
>> >> Saludos,
>> >> .as
>> >>
>> >>
>> >>
>> >>
>> >> _______________________________________________
>> >> LACTF mailing list
>> >> LACTF at lacnic.net
>> >> https://mail.lacnic.net/mailman/listinfo/lactf
>> >>
>> > _______________________________________________
>> > LACTF mailing list
>> > LACTF at lacnic.net
>> > https://mail.lacnic.net/mailman/listinfo/lactf
>>
>> _______________________________________________
>> LACTF mailing list
>> LACTF at lacnic.net
>> https://mail.lacnic.net/mailman/listinfo/lactf
>>
>
> _______________________________________________
> LACTF mailing list
> LACTF at lacnic.net
> https://mail.lacnic.net/mailman/listinfo/lactf
>
>
>
> _______________________________________________
> LACTF mailing list
> LACTF at lacnic.net
> https://mail.lacnic.net/mailman/listinfo/lactf
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.lacnic.net/pipermail/lactf/attachments/20110305/a8ec4e76/attachment.html>


More information about the LACTF mailing list