unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient,
IdHTTP, IdAuthentication;
type
TForm2 =
class(TForm)
IdHTTP1: TIdHTTP;
Label1: TLabel;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure IdHTTP1ProxyAuthorization(Sender: TObject;
Authentication: TIdAuthentication;
var Handled: Boolean);
private
procedure ConfigIdHTTP;
public
{ Public-Deklarationen }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
uses
Unit3;
procedure TForm2.ConfigIdHTTP;
begin
IdHTTP1.ProxyParams.ProxyServer := '
proxy.domain.de';
IdHTTP1.ProxyParams.ProxyPort := 8080;
IdHTTP1.ProxyParams.BasicAuthentication := true;
Label1.Caption := IdHTTP1.Get('
http://ip.smartcoder.net/txt/');
end;
procedure TForm2.IdHTTP1ProxyAuthorization(Sender: TObject;
Authentication: TIdAuthentication;
var Handled: Boolean);
begin
if Form3.ShowModal = mrOK
then
begin
Authentication.Username := Form3.LabeledEdit1.Text;
Authentication.Password := Form3.LabeledEdit2.Text;
end;
end;
procedure TForm2.Button1Click(Sender: TObject);
begin
ConfigIdHTTP;
end;
end.