// Weißt Indy die Proxydaten zu
procedure TForm1.Button1Click(Sender: TObject);
begin
idhttp1.ProxyParams.ProxyServer:=server.Text;
idhttp1.ProxyParams.ProxyPort:=StrToInt(proxy.Text);
end;
// Ruft eine HP auf und schreibt den Quelltext in ein Memo
// Fehlermeldungen entstehen ab hier.
// Fehlermeldung Ohne Text erst, wenn Button1Click ausgeführt wurde
procedure TForm1.Button3Click(Sender: TObject);
begin
memo1.Lines.Add(idhttp1.get(
url.text))
end;
// Methode 1
procedure TForm1.IdHTTP1ProxyAuthorization(Sender: TObject;
Authentication: TIdAuthentication;
var Handled: Boolean);
begin
if Checkbox3.Checked
then begin;
Authentication.Username := Username.Text;
Authentication.Password := passwort.Text;
end;
end;
// Methode 2
procedure TForm1.IdHTTPMainSelectProxyAuthorization(Sender: TObject;
var AuthenticationClass: TIdAuthenticationClass; AuthInfo: TIdHeaderList);
begin
if checkbox2.Checked
then begin;
// First check for NTLM authentication, as you do not need to set username and password because Indy will automatically
// handle passing your Windows Domain username and password to the proxy server
if (pos('
Proxy-Authenticate: NTLM', IdHTTP1.Response.RawHeaders.Text)>0)
then begin
IdHTTP1.ProxyParams.BasicAuthentication := false;
AuthenticationClass := TIdSSPINTLMAuthentication;
end
else begin
//Next check for Basic
if (pos('
Proxy-Authenticate: Basic', IdHTTP1.Response.RawHeaders.Text)>0)
then begin
AuthenticationClass := TIdBasicAuthentication;
IdHTTP1.ProxyParams.BasicAuthentication := true;
end
else begin
// Then Digest
if (pos('
Proxy-Authenticate: Digest', IdHTTP1.Response.RawHeaders.Text)>0)
then AuthenticationClass := TIdDigestAuthentication
end;
//.------------
IdHTTP1.ProxyParams.ProxyUsername := username.Text;
IdHTTP1.ProxyParams.ProxyPassword := Passwort.Text;
end;
end;
end;
// Wahl der SSL Methode
procedure TForm1.RadioGroup1Click(Sender: TObject);
begin
case radiogroup1.ItemIndex
of
0: form1.IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvsslV2;
1: form1.IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvsslV3;
2: form1.IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvsslV23;
3: form1.IdSSLIOHandlerSocketOpenSSL1.SSLOptions.Method:=sslvTLSV1
end;