HTTPProxy - authenticated proxy servers supported?
Dave Cragg
dcragg at lacscentre.co.uk
Thu Aug 21 05:40:01 EDT 2003
At 1:29 pm +1200 21/8/03, Rodney Tamblyn wrote:
>It appears that authenticated proxy servers are not supported in
>Metacard/Revolution. Please tell me I am wrong.
You're kind of wrong. :)
If you know in advance that proxy authentication is required, you
need to set the httpHeaders appropriately. The header should look
something like this:
Proxy-Authorization: <stuff>
What you need to put in place of <stuff> depends on the
authentication scheme being used. If it's the Basic authorization
scheme, then the header will look like this:
Proxy-Authorization: Basic <base64 encoded string>
where the base64-encoded string is a base64 encoding of the user ID,
a colon, and the password. So:
put <ID> into tID
put <password> into tPass
put base64Encode(tID & ":" & tPass) into tString
set the httpHeaders to "Proxy-Authorization:" && tString
If another scheme is used (digest, kerberos, etc.) you have more work
to do. (But I think someone once posted a way of handling Digest
authorization on one of the Rev or MC lists. So a look through the
archives might help.)
There is information on the Digest and Basic schemes here:
<http://www.faqs.org/rfcs/rfc2617.html>
If you don't know in advance whether proxy-authenitication is
required, you can find out by getting the result of an http url call.
It should return "error 407 " followed by a text description. In that
case, you'll then have to find a "Proxy-authenicate" field in the
headers returned by the proxy server. You can get the headers by
using the libUrlLastRhHeaders() function.
Cheers
Dave
More information about the metacard
mailing list