Xymon Mailing List Archive search

Http test behind proxy

4 messages in this thread

list Kevin Hanrahan · Wed, 26 Jan 2005 23:52:54 -0500 ·
My Hobbit server sits behind a proxy server that requires authentication
before it will allow access to the internet. How do I test external hosts
(for http for instance) from here? Is there a way to pass credentials to the
proxy server to allow access?

Thanks 

KEvin
list Henrik Størner · Thu, 27 Jan 2005 08:17:23 +0100 ·
quoted from Kevin Hanrahan
On Wed, Jan 26, 2005 at 11:52:54PM -0500, Kevin Hanrahan wrote:
My Hobbit server sits behind a proxy server that requires authentication
before it will allow access to the internet. How do I test external hosts
(for http for instance) from here? Is there a way to pass credentials to the
proxy server to allow access?
See the bb-hosts man-page, in the section "HTTP Testing via proxy"


Henrik
list Kevin Hanrahan · Fri, 28 Jan 2005 13:42:51 -0500 ·
Henrik,
Thank you for that info. In doing this I noticed something that may not be
considered a bug but maybe an annoyance?...you decide.

The format stated is:

 If your proxy requires authentication, you can specify the username and
password inside the proxy-part of the URL, e.g. 

    http://fred:user-a44e509d68fd@xymon.invalid:3128/http://www.foo.com/ 
will authenticate to the proxy using a username of "fred" and a password of
"Wilma1", before requesting the proxy to fetch the www.foo.com homepage


But my password contains the "@" symbol (which appears to be the delimiter
between password and proxy server) and when I used it in this example:

http://kevin:p at user-763c6dc003fa@xymon.invalid:8080/http://www.foo.com/

I got a DNS error. I am guessing it thought my proxy was "ssword" or maybe
"user-763c6dc003fa@xymon.invalid which is incorrect and could no be resolved.
Is there a way around this? 

In my case, I just created another user with a password that didn't contain
the "@" but this might not be possible for others.


-----Original Message-----
From: Henrik Stoerner [mailto:user-ce4a2c883f75@xymon.invalid] 
Sent: Thursday, January 27, 2005 2:17 AM
To: user-ae9b8668bcde@xymon.invalid
Subject: Re: [hobbit] Http test behind proxy
Importance: Low
quoted from Kevin Hanrahan

On Wed, Jan 26, 2005 at 11:52:54PM -0500, Kevin Hanrahan wrote:
My Hobbit server sits behind a proxy server that requires 
authentication before it will allow access to the internet. How do I 
test external hosts (for http for instance) from here? Is there a way 
to pass credentials to the proxy server to allow access?
See the bb-hosts man-page, in the section "HTTP Testing via proxy"


Henrik
list Henrik Størner · Fri, 28 Jan 2005 20:30:23 +0100 ·
quoted from Kevin Hanrahan
On Fri, Jan 28, 2005 at 01:42:51PM -0500, Kevin Hanrahan wrote:
 If your proxy requires authentication, you can specify the username and
password inside the proxy-part of the URL, e.g. 

    http://fred:user-a44e509d68fd@xymon.invalid:3128/http://www.foo.com/ 
will authenticate to the proxy using a username of "fred" and a password of
"Wilma1", before requesting the proxy to fetch the www.foo.com homepage

But my password contains the "@" symbol
Yuck - and you're in trouble too if it contains a ":". Right ...

How about escaping it the way you normally do with URL's ? I.e instead
of "@" you'd have "%40" (because the ascii value for "@" is hex 40),
does that seem reasonable ?

If so, then it's a simple one-line change. And it will only break the
setup for those who already use authentication and have a "%" in their
username or password ...


--- lib/url.c   2005/01/20 22:02:23     1.9
+++ lib/url.c   2005/01/28 19:28:31
@@ -353,7 +353,7 @@
        p = strchr(netloc, '@');
        if (p) {
                *p = '\0';
-               url->auth = strdup(netloc);
+               url->auth = strdup(urlunescape(netloc));
                netloc = (p+1);
        }
        p = strchr(netloc, '=');


Henrik