Board index » delphi » TNMHTTP vs. TIdHTTP in proxy situations

TNMHTTP vs. TIdHTTP in proxy situations

Hi all;

I moved one D5 application used by a wide range of users, from TNMHTTP to
TIdHTTP, and I am getting now from bug reports from users that connects to
the Internet with providers that has proxy servers. My old stuff was:

    nmHttp.Host := 'www.the-site.com';
    nmHttp.Port := 80;
    nmHttp.Proxy := 'the-proxy';
    nmHttp.ProxyPort := nProxyPort;

With this code tha application works very well, and no problems are
reported. Now my code is

    idHttp.Host := 'www.the-site.com';
    idHttptp.Port := 80;
    idHttp.ProxyParams.ProxyServer := 'the-proxy';
    idHttp.ProxyParams.ProxyPort := nProxyPort;

... and when there is a proxy it fails to connect. First I thought about an
authentication problem, but I noted my old stuff does not any
authentication.

What is missed?

Thank you.

Daniel.

 

Re:TNMHTTP vs. TIdHTTP in proxy situations


... BTW, here is my object definition:

  object Ht: TIdHTTP
    MaxLineAction = maException
    ReadTimeout = 300000
    OnWork = HtWork
    OnWorkBegin = HtWorkBegin
    OnWorkEnd = HtWorkEnd
    AllowCookies = True
    ProxyParams.BasicAuthentication = False
    ProxyParams.ProxyPort = 0
    Request.ContentLength = -1
    Request.ContentRangeEnd = 0
    Request.ContentRangeStart = 0
    Request.ContentType = 'text/html'
    Request.Pragma = 'no-cache'
    Request.Accept = 'text/html, */*'
    Request.BasicAuthentication = False
    Request.UserAgent = 'Mozilla/3.0 (compatible; Indy Library)'
    HTTPOptions = [hoForceEncodeParams]
    Left = 384
    Top = 25
  end

Daniel

Re:TNMHTTP vs. TIdHTTP in proxy situations


Ok... I am talking alone; but if somebody want to konw, I found the problem
was when using  TNMHTTP to see if the connection is possible in this way:

nmHttp.Connect; nmHttp.DisConnect;

I removed that code in my approach with TIdHTTP, and now it is working.

Daniel.

Other Threads