Newsgroups : Borland : borland.public.delphi.internet.winsock : 2007 Dec : Re: idfTP and Socks problem
| Subject: | Re: idfTP and Socks problem |
| Posted by: | "Richard" (ritchie8..@yahoo.com) |
| Date: | Mon, 10 Dec 2007 22:31:12 |
"Remy Lebeau (TeamB)" <no.spam@no.spam.com> wrote in message
news:475da9e2$2@newsgroups.borland.com...
>> I read the entire thread before replying earlier. Like I said before, it
> makes no difference whatsoever what the Owner is set to. So something
> else has to be happening.
>
Well, place a button and an idsocksinfo in a form.
When pressing the button:
unit Unit3;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, IdCustomTransparentProxy, IdSocks, IdIOHandler,
IdIOHandlerSocket,
IdIOHandlerStack, IdBaseComponent, IdComponent, IdTCPConnection,
IdTCPClient,
IdExplicitTLSClientServerBase, IdFTP, StdCtrls;
type
TForm3 = class(TForm)
IdSocksInfo1: TIdSocksInfo;
Button1: TButton;
procedure Button1Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
private
FSocks:TIdSocksInfo;
FHandlerStack: TIdIOHandlerStack;
Worker: Tidftp;
kk: tcheckbox;
public
{ Public declarations }
end;
var
Form3: TForm3;
implementation
{$R *.dfm}
procedure TForm3.Button1Click(Sender: TObject);
begin
FSocks.Authentication:= saUsernamePassword;
FSocks.Host:= 'some bogus server';
FSocks.Password:= 'leqrewqrqe';
FSocks.Port:= 7070;
FSocks.Username:= 'sdf';
FSocks.Version:= svSocks5;
FHandlerStack.TransparentProxy:= FSocks;
Worker.ProxySettings.ProxyType:= fpcmNone;
Worker.ProxySettings.Host:= '';
Worker.ProxySettings.Port:= 0;
Worker.ProxySettings.UserName:= '';
Worker.ProxySettings.Password:= '';
Worker.Host:= 'ftp://ftp.ubuntu.com';
Worker.Port:= 21;
Worker.Username:= 'annonymous';
Worker.Password:= 'sdds@sdds.dd;
Worker.IOHandler:= FHandlerStack;
Worker.Connect;
end;
procedure TForm3.FormCreate(Sender: TObject);
begin
kk:= tcheckbox.Create(nil);
FSocks:= TIdSocksInfo.Create(nil);
FHandlerStack:= TIdIOHandlerStack.Create(nil);
Worker:= TIdFTP.Create(nil);
end;
procedure TForm3.FormDestroy(Sender: TObject);
begin
FSocks.Free;
FHandlerStack.free;
Worker.free;
kk.Free;
end;
end.
Now press the button.
now test changing the line
FHandlerStack.TransparentProxy:= FSocks; with
FHandlerStack.TransparentProxy:= IdSocksInfo1; // which ha´s the same
settings than Fsocks
See the difference?