Hi DragonSlayer,
My problems are:
1. How to combine these two components? Do I need other components? You said TIdSocksInfo.Connection but how to set it? There is no such property (Undeclared identifier error)
2. Should I explicitly call TIdSocksInfo.MakeSocksConn
3. What about TIdFTP.ProxySetting? Should I set them also?
The following is my current code for making a connection which doesn't work. It works if I don't use SOCKS. I've changed the following properties manually (in Object Inspector):
TIdFTP: Host, Port, Username, Password
TIdSocksInfo - nothing
procedure TForm1.Button1Click(Sender
var i: integer;
begin
// the following if was added for SOCKS
if CheckBox1.Checked then begin
with IdSocksInfo1 do begin
Host := edtSHost.Text; // here I enter the local IP of the SOCKS proxy, its port, username and password
Port := StrToInt(edtSPort.Text);
Username := edtSUser.Text;
Password := edtSPass.Text;
if cbSAuth.Text = 'No' then begin
Authentication := saNoAuthentication;
end else begin
Authentication := saUsernamePassword;
end;
if cbSVersion.Text = 'No' then Version := svNoSocks;
if cbSVersion.Text = 'Socks4' then Version := svSocks4;
if cbSVersion.Text = 'Socks4A' then Version := svSocks4A;
if cbSVersion.Text = 'Socks5' then Version := svSocks5;
// Connection := IdFTP1; // added after your comment
MakeSocksConnection(IdFTP1
end;
end;
try
if CheckBox1.Checked then begin
IdFTP1.Passive := true;
end else begin
IdFTP1.Passive := false;
end;
IdFTP1.Connect;
Label3.Caption := IdFTP1.RetrieveCurrentDir;
RichEdit1.Lines.Add('->Sys
RichEdit1.Lines.Add(IdFTP1
RichEdit1.Lines.Add('->Log
for i := 0 to IdFTP1.LoginMsg.Text.Count
RichEdit1.Lines.Add(IdFTP1
end;
RichEdit1.Lines.Add('->Gre
for i := 0 to IdFTP1.Greeting.Text.Count
RichEdit1.Lines.Add(IdFTP1
end;
ShowCurrentFolder(RichEdit
except
ShowMessage('Connect failed');
end;
end;
---
Regards, Geo
Main Topics
Browse All Topics





by: DragonSlayerPosted on 2003-05-22 at 21:52:53ID: 8569490
to use passive mode, set the TIdFTP's Passive property to True.
to use authentication just set the values of Username and Password.
to use SOCKS5, drop a TIdSocksInfo component onto your form, set the right auth. values (username/password) and the version of SOCKS (5 in this case), then set the Connection property to point to you TIdFTP component.
Now you are ready to go :)