 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Alan Garny Guest
|
Posted: Mon Jan 12, 2004 8:46 pm Post subject: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
Ok, I have been battling for quite some time for using TIdHTTP from behind a
proxy server. I don't seem to get it to work (keep getting that annoying
"HTTP/1.1 407 Proxy Authentication Required"), despite what I think is a
valid code (see my other message). This would therefore confirm what I have
seen in other messages, i.e. there is something broken with TIdHTTP using a
proxy server.
Now, the question is to know whether someone:
1) has actually managed to use TIdHTTP with a proxy and if so, what did you
have to do? I am happy to admit I made a mistake, but for that I need
someone who shows me I have made one... :)
2) has given up on using TIdHTTP with a proxy and, if so, what other
solution s/he has decided to use instead, keeping in mind I need a free
solution (my project is open source).
Cheers, Alan.
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Mon Jan 12, 2004 8:50 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Ben Hochstrasser [FF]" <bhoc@tiscali123^H^H^H.ch> wrote
| Quote: | Alan Garny wrote:
Now, the question is to know whether someone:
What style of authentication does your proxy expect? Plain text?
"Integrated" (aka NTLM) authentication? Some other method?
|
I don't know and I am not sure it should matter. I mean that in the worst
case, the user should be allowed to specify which method is to be used, no?
Ideally, it would be determined automatically. Either way, I don't know how
to do that... so if you know, I would be more than happy to learn from
you...
Alan.
|
|
| Back to top |
|
 |
CleverComponents Team Guest
|
Posted: Mon Jan 12, 2004 9:49 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
Dear Alan,
Please try Clever Internet Suite v 3.3 at
http://www.clevercomponents.com/downloads/inetsuite.asp - it perfectly
compatible with proxy (including NTLM proxy authentification)
Other Clever Internet Suite links:
- Home Page http://clevercomponents.com/products/inetsuite/suite.asp
- Downloads http://clevercomponents.com/downloads/inetsuite.asp
- Compiled Demos http://clevercomponents.com/downloads/inetsuite.asp
- Online Demos http://clevercomponents.com/products/inetsuite/demos.asp
- History http://clevercomponents.com/products/inetsuite/suitehistory.asp
- FAQ http://clevercomponents.com/products/inetsuite/inetsuitefaqs.asp
With Best Regards,
Clever Components Team
http://www.clevercomponents.com
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote
| Quote: | Ok, I have been battling for quite some time for using TIdHTTP from behind
a
proxy server. I don't seem to get it to work (keep getting that annoying
"HTTP/1.1 407 Proxy Authentication Required"), despite what I think is a
valid code (see my other message). This would therefore confirm what I
have
seen in other messages, i.e. there is something broken with TIdHTTP using
a
proxy server.
Now, the question is to know whether someone:
1) has actually managed to use TIdHTTP with a proxy and if so, what did
you
have to do? I am happy to admit I made a mistake, but for that I need
someone who shows me I have made one... :)
2) has given up on using TIdHTTP with a proxy and, if so, what other
solution s/he has decided to use instead, keeping in mind I need a free
solution (my project is open source).
Cheers, Alan.
|
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Mon Jan 12, 2004 10:07 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"CleverComponents Team" <info (AT) CleverComponents (DOT) com> wrote
Too bad, I said a free solution (and with source code, in fact)... and there
is no way around that...
Alan.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Mon Jan 12, 2004 10:25 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote
| Quote: | I don't know and I am not sure it should matter.
|
Yes, it makes a BIG difference. Different authentication schemes encode the
login info that is sent to the proxy in VERY different ways. You must know
the exact authentication scheme that the proxy is actually using so that you
can then configure TIdHTTP to login to the proxy in the correct manner.
| Quote: | I mean that in the worst case, the user should be allowed to specify
which method is to be used, no?
|
Yes, but then you have to actually set up the TIdHTTP accordingly.
| Quote: | Ideally, it would be determined automatically.
|
For TIdHTTP to do that, you need to add the various TIdAuthentication...
units (TIdAuthenticationDigest, TIdAuthenticationNTLM,
TIdAuthenticationSSPI) to your programs' 'uses' clause. Even then, that is
not a guarantee that everything will be handled automatically 100% for you.
You will probably still have to interact with the values a little bit.
Gambit
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Mon Jan 12, 2004 10:35 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: | "Alan Garny" <someone (AT) somewhere (DOT) com> wrote in message
news:400308c2 (AT) newsgroups (DOT) borland.com...
I don't know and I am not sure it should matter.
Yes, it makes a BIG difference. Different authentication schemes encode
the
login info that is sent to the proxy in VERY different ways. You must
know
the exact authentication scheme that the proxy is actually using so that
you
can then configure TIdHTTP to login to the proxy in the correct manner.
|
That, I agree with.
| Quote: | I mean that in the worst case, the user should be allowed to specify
which method is to be used, no?
Yes, but then you have to actually set up the TIdHTTP accordingly.
|
Yes, how do we do that then?
| Quote: | Ideally, it would be determined automatically.
For TIdHTTP to do that, you need to add the various TIdAuthentication...
units (TIdAuthenticationDigest, TIdAuthenticationNTLM,
TIdAuthenticationSSPI) to your programs' 'uses' clause. Even then, that
is
not a guarantee that everything will be handled automatically 100% for
you.
You will probably still have to interact with the values a little bit.
|
Adding the units is ok, but what next? Surely, to add them alone won't do
the trick, right?
Man, what a mess! Sorry, but I am really getting disappointed with that
TIdHTTP component. There are programs that only require the information I
ask my user to go through a proxy, so why can't I do the same? Surely, it
must be possible! No??
Alan.
PS: it sounds to me like nobody has ever managed to use TIdHTTP with a proxy
server. If I am wrong, please show me some code! Until that proxy thing, I
thought the Indy components were great, but now that one of my users is
behind a proxy and cannot access my web site, I think they s*ck big time!
Yes, that's the end of the day, so I guess I am getting a bit tired and easy
to upset...
|
|
| Back to top |
|
 |
Ben Hochstrasser [FF] Guest
|
Posted: Mon Jan 12, 2004 11:38 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
Alan Garny wrote:
| Quote: | Too bad, I said a free solution (and with source code, in fact)... and
there is no way around that...
|
Synapse. Reportedly (did it myself) works with proxy.
Do you have to log on to your proxy with MSIE? No? Then you're using SSPI
or NTLM, else you probably use Basic (aka clear text) authentication.
--
Ben
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Jan 13, 2004 12:03 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote
| Quote: | Yes, how do we do that then?
|
Use the ProxyParams.Authentication property. You set it to the class
instance of the particular authentication scheme to use, and then fill in
that instance accordingly.
| Quote: | Adding the units is ok, but what next? Surely, to add them alone won't do
the trick, right?
|
Yes, it would. Each unit has a RegisterAuthenticationMethod() call in its
Initialization section. TIdHTTP can then look at the server's initial
connection response to see what kind of authentication it is expecting, then
it can look through the currently registered TIdAuthentication classes for a
match, and if found then use it.
| Quote: | Man, what a mess! Sorry, but I am really getting disappointed with that
TIdHTTP component.
|
This has nothing to do with TIdHTTP specifically. You need to understand
how HTTP authentication works in general to begin with, then you will begin
to understand why TIdHTTP is designed the way it is. Keep in mind that
everything in Indy is designed with scalability and flexibility in mind, so
things are generalized alot.
| Quote: | There are programs that only require the information I ask my user
to go through a proxy
|
Such programs are most likely setup to either 1) only work with specific
types of authentications, or 2) they are written to work with ALL
authentication types and then automatically pick which ones to use sothat
the user never knows what is going on. Indy is the latter, except that
everything is modularized and those modules are not all enabled by default,
it would bloat the component too much for everyone else who just need basic
HTTP services. If you want advanced features, like proxying, you simply
plugin in the extra pieces that are needed, configure them, and off you go.
| Quote: | PS: it sounds to me like nobody has ever managed to use TIdHTTP
with a proxy server.
|
I doubt that very much. TIdHTTP has had proxy support for a long time. If
nobody were having any luck with it at all, there would have been a lot more
bug reports, and a lot more attention focused on it.
Gambit
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Tue Jan 13, 2004 12:50 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: | "Alan Garny" <someone (AT) somewhere (DOT) com> wrote in message
news:4003214f$3 (AT) newsgroups (DOT) borland.com...
Adding the units is ok, but what next? Surely, to add them alone won't
do
the trick, right?
Yes, it would. Each unit has a RegisterAuthenticationMethod() call in its
Initialization section. TIdHTTP can then look at the server's initial
connection response to see what kind of authentication it is expecting,
then
it can look through the currently registered TIdAuthentication classes for
a
match, and if found then use it.
|
I just had a look at them and indeed... except that the Digest
authentication method is untested (dixit a comment by Doychin Bondzhev in
the code) and that the call to "RegisterAuthenticationMethod" in the
initialization section is commented out... so, that leaves me the basic and
NTLM authentication to play with...
| Quote: | Man, what a mess! Sorry, but I am really getting disappointed with
that
TIdHTTP component.
This has nothing to do with TIdHTTP specifically. You need to understand
how HTTP authentication works in general to begin with, then you will
begin
to understand why TIdHTTP is designed the way it is. Keep in mind that
everything in Indy is designed with scalability and flexibility in mind,
so
things are generalized alot.
|
Yes, I start seeing that... still the documentation is not very helpful...
not to mention that in my copy of D7, there is no Indy demo. Fair enough
there is a file that points to their web site, so I went there... but
nothing... unless I didn't look in the right place...
| Quote: | There are programs that only require the information I ask my user
to go through a proxy
Such programs are most likely setup to either 1) only work with specific
types of authentications, or 2) they are written to work with ALL
authentication types and then automatically pick which ones to use sothat
the user never knows what is going on. Indy is the latter, except that
everything is modularized and those modules are not all enabled by
default, |
or tested for that matter... <g>
| Quote: | it would bloat the component too much for everyone else who just need
basic
HTTP services. If you want advanced features, like proxying, you simply
plugin in the extra pieces that are needed, configure them, and off you
go. |
That's fair enough. As it happens, I like that kind of approach. It's just
not very clear at first glance.
| Quote: | PS: it sounds to me like nobody has ever managed to use TIdHTTP
with a proxy server.
I doubt that very much. TIdHTTP has had proxy support for a long time.
If
nobody were having any luck with it at all, there would have been a lot
more
bug reports, and a lot more attention focused on it.
|
Well, as I said I did spend quite a bit of time, before posting here,
looking for a solution in the archives, but was more than unsuccessful.
Again, I am more than happy to be proven wrong... but so far, everything
seems to prove me right... unfortunately...
This said, I will, whenever I have a bit of time (this whole TIdHTTP+Proxy
issue has already taken far too much of my limited free time) have a proper
look at that authentication property, even thought the digest method doesn't
seem reliable as it stands (for it hasn't been tested).
Alan.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Jan 13, 2004 2:28 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote
| Quote: | I just had a look at them and indeed... except that the Digest
authentication method is untested (dixit a comment by Doychin
Bondzhev in the code) and that the call to
"RegisterAuthenticationMethod" in the initialization section is
commented out... so, that leaves me the basic and NTLM
authentication to play with...
|
There was a discussion on that not too long ago. Try looking at past
messages.
| Quote: | Yes, I start seeing that... still the documentation is not very helpful...
|
Complain to the documentation people about that. They have thier own group.
And if you are really interested in getting better docs, you could always
join the group yourself and contribute to them.
Gambit
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Tue Jan 13, 2004 9:25 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: |
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote in message
news:400340cc (AT) newsgroups (DOT) borland.com...
I just had a look at them and indeed... except that the Digest
authentication method is untested (dixit a comment by Doychin
Bondzhev in the code) and that the call to
"RegisterAuthenticationMethod" in the initialization section is
commented out... so, that leaves me the basic and NTLM
authentication to play with...
There was a discussion on that not too long ago. Try looking at past
messages.
|
Will do.
| Quote: | Yes, I start seeing that... still the documentation is not very
helpful...
Complain to the documentation people about that. They have thier own
group.
And if you are really interested in getting better docs, you could always
join the group yourself and contribute to them.
|
Well, I am sorry, but I am already working on my own open source project
during my free time, so that doesn't leave me much free time (not to say
none at all). Not to mention that having the Indy components shipped with
D7, I would have expected some kind of support, but I guess I was wrong...
maybe I shouldn't be too surprised coming from Borland (due to their
legendary level of documentation - sarcasm).
Anyway, I have managed to get the proxy server details (basic
authentication) and authentication settings from my user. I should be able
to properly trace the problem from there...
Alan.
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Tue Jan 13, 2004 9:48 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Ben Hochstrasser [FF]" <bhoc@tiscali123^H^H^H.ch> wrote
| Quote: | Alan Garny wrote:
Too bad, I said a free solution (and with source code, in fact)... and
there is no way around that...
Synapse. Reportedly (did it myself) works with proxy.
|
Just out of interest, I gave it a try and it seems to be working fine, so at
this stage I will assume I have done something wrong with TIdHTTP...
This said, there doesn't appear to be a way to set pragma options. In other
words, there doesn't seem to be a way to specify that the document should be
retrieved from the web site and not the cache (i.e. "no-cache" option).
I have, however, hard coded it and it works nicely with it. So, overall, to
add "Pragma: no-cache" to the header does the trick. Not to mention that
authentication works fine.
I will, nonetheless, go back to TIdHTTP, as I would very much like to
understand what is going with that component... but at least, I now seem to
have a working solution (at least for basic authentication).
Alan.
|
|
| Back to top |
|
 |
Alan Garny Guest
|
Posted: Tue Jan 13, 2004 9:53 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Remy Lebeau (TeamB)" <gambit47.no.spam (AT) no (DOT) spam.yahoo.com> wrote
| Quote: | "Alan Garny" <someone (AT) somewhere (DOT) com> wrote in message
news:4003b98f (AT) newsgroups (DOT) borland.com...
Not to mention that having the Indy components shipped with D7,
I would have expected some kind of support, but I guess I was
wrong... maybe I shouldn't be too surprised coming from Borland
(due to their legendary level of documentation - sarcasm).
Borland has nothing to do with Indy. Indy's developers provide their own
support for Indy, Borland does not do that for them. Any issues you have
with Indy need to be directed to Indy's people directly, not Borland's.
Some of them frequent this group, and several frequent Indy's own
newsgroups
at news.atozedsoftware.com.
|
I understand that Borland has nothing to do with Indy, yet I wish they were
a bit more constraining when components are to be added to the whole Delphi
package. I mean that, surely, I am not the only one to use all those
non-Borland tools that are shipped with D7. So, in that respect, I would
hope not to have to get in touch with every single one group/company that
developed those tools, should they be broken, etc. not to mention that some
of those groups/companies may go out of business.
Ok, enough criticism... )
Thanks for the newsgroup address. I will give it a try.
Alan.
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Tue Jan 13, 2004 9:53 am Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote
| Quote: | Not to mention that having the Indy components shipped with D7,
I would have expected some kind of support, but I guess I was
wrong... maybe I shouldn't be too surprised coming from Borland
(due to their legendary level of documentation - sarcasm).
|
Borland has nothing to do with Indy. Indy's developers provide their own
support for Indy, Borland does not do that for them. Any issues you have
with Indy need to be directed to Indy's people directly, not Borland's.
Some of them frequent this group, and several frequent Indy's own newsgroups
at news.atozedsoftware.com.
Gambit
|
|
| Back to top |
|
 |
Chad Z. Hower aka Kudzu Guest
|
Posted: Tue Jan 13, 2004 1:28 pm Post subject: Re: HTTP + Proxy - Anyone tried it in Delphi? |
|
|
"Alan Garny" <someone (AT) somewhere (DOT) com> wrote in news:4003c000$1
@newsgroups.borland.com:
| Quote: | I understand that Borland has nothing to do with Indy, yet I wish they were
a bit more constraining when components are to be added to the whole Delphi
package. I mean that, surely, I am not the only one to use all those
|
Youve missed the entire point.
Borland only provides peer support on these NGs for their own products -
which is the same that is provided for Indy.
For priority support for Delphi, you have to pay Borland.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Need extra help with an Indy problem?
http://www.atozed.com/indy/experts/support.html
ELKNews - Get your free copy at http://www.atozedsoftware.com
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|