Autor Beitrag
jackie05
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 357



BeitragVerfasst: Mo 17.11.08 21:10 
Hallo,
wie könnte ich mit der Indy Komponente eine Proxyliste öffnen und irgendeine IP zuweisen, weiss jetzt nicht so richtig, wie ich das beschreiben soll.

Ich möchte das meine IP sich ändert nach dem Button Klick, diese in einer Proxy liste vorhanden ist.

Ich habe das mal so versucht:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdHTTP, IdAuthentication;

type
  TForm1 = class(TForm)
    IdHTTP1: TIdHTTP;
    Button1: TButton;
    Memo1: TMemo;
    Label1: TLabel;
    Button2: TButton;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure IdHTTP1ProxyAuthorization(Sender: TObject;
      Authentication: TIdAuthentication; var Handled: Boolean);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
begin
  IdHTTP1.ProxyParams.ProxyServer := 'proxy.domain.de';
  IdHTTP1.ProxyParams.ProxyPort := 80;
  IdHTTP1.ProxyParams.BasicAuthentication := true;
end;

procedure TForm1.IdHTTP1ProxyAuthorization(Sender: TObject;
  Authentication: TIdAuthentication; var Handled: Boolean);
begin
  Authentication.Username := 'jackie05';
  Authentication.Password := 'test';
end;

end.


Wieso brauche ich eigentlich den Benutzername und das Passwort?
Wenn ich im Internet Explorer unter Proxy Einstellungen die Proxyliste eintrage, da muss ich kein Benutzername oder Passwort eingeben.

Naja, irgendwie funktioniert das nicht so richtig und ich weiss nicht, ob ich das so richtig gemacht habe.

Edit: Ich hab mal ein Screen von Internet Explorer gemacht:
Screen

Ich möchte mit der Indy Komponente den Quelltext einer Website auslesen, das ist kein problem, aber ich möchte das ganze über den Proxy laufen lassen, wie im Internet Explorer.

Ich danke euch schonmal für die Hilfe.

MfG