[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [SLUG] wget with proxy authentication
> > http://hniksic:mypassword@nospam.proxy.company.com:8001/
>
> Yes, thanks, but...
> My username contain the '@nospam.' character (I can't change it) and wget responds
> with invalid port specification or not recognized it at all. How to solve the
> problem?
Go with the source gizmox.
In url.c there is the following function that does all the parsing of the
URL you enter. It determines if you have a user and password set by
looking for the literal @nospam. character (in a function named skip_uname).
parseurl (const char *url, struct urlinfo *u, int strict)
{
/* Allow a username and password to be specified (i.e. just skip
them for now). */
if (recognizable)
l += skip_uname (url + l);
for (i = l; url[i] && url[i] != ':' && url[i] != '/'; i++);
So you cant have the @nospam. anywhere else or it brakes it. A little futher on
it does the actual parsing out of the user and password.
/* Parse the username and password (if existing). */
parse_uname (url, &u->user, &u->passwd);
/* Decode the strings, as per RFC 1738. */
decode_string (u->host);
decode_string (u->path);
if (u->user)
decode_string (u->user);
if (u->passwd)
decode_string (u->passwd);
Now the good news is that after it has extracted out the user and password
it calles decode_string on them. This means that you can escape your
special characters and it will decode them for you,
You should therefore be able to use %40 instead of your @nospam. character.
Give
http://user%40domain:mypassword@nospam.proxy.company.com:8001/
Let us know if it works.
Rodos
--
rodos@nospam.haywood.org | Beware of programmers who carry screwdrivers. [Leonard
Camion Technology | Brandwein]
+61 2 9873 5105 |
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to slug-request@nospam.slug.org.au with
unsubscribe in the text