Thema: Delphi Proxy Programmieren

Einzelnen Beitrag anzeigen

Benutzerbild von arbu man
arbu man

Registriert seit: 3. Nov 2004
Ort: Krefeld
1.108 Beiträge
 
Delphi 7 Professional
 
#9

Re: Proxy Programmieren

  Alt 25. Feb 2007, 10:58
So hab es jetzt raus wie es richtig geht:

Delphi-Quellcode:

procedure TNXProxyWindow.HTTPServerCommandGet(AContext: TIdContext;
  ARequestInfo: TIdHTTPRequestInfo; AResponseInfo: TIdHTTPResponseInfo);
var
  URL, s: string;
begin
  URL := 'http://'+ARequestInfo.Host+ARequestInfo.Document;
  try
    while HTTP.Tag=1 do Application.ProcessMessages;
    HTTP.Tag:=1;
    s := HTTP.Get(URL);
    AResponseInfo.ContentText := s;
    AResponseInfo.ContentType := HTTP.Response.ContentType;
    HTTP.Tag:=0;
  except
    // Handle Errors
  end;
  // Loging
  // ...
end;
mfg, Björn
Björn
>> http://bsnx.net <<
Virtual DP Stammtisch v1.0"iw" am 19.09.2007 - ich war dabei!
  Mit Zitat antworten Zitat