[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Patch to add direct FTP proxy support in kio_ftp
From:       Michael Goffioul <goffioul () imec ! be>
Date:       2001-06-28 17:57:41
[Download RAW message or body]

> > I didn't get your point here. The patch I posted avoid having username in
> > the URL in the form of login@host:port, so you don't have garbage '@'
> > anymore. On the other hand the patch simply change how the ftp ioslave
> > issues a "USER" command: instead of the form "USER login", it issues "USER
> > login@remote:host". But this command is issued to the FTP proxy server (not
> > the target remote FTP server) and this proxy server SHOULD understand it,
> > as it is how it works. The FTP proxy server does NOT ask for "USER
> > login%40host:port" with the '@' encoded, it simply won't work. So I don't
> > see the point here with the encoded '@'.
> 
> Hmm... then I think I mis-understood your prior comment.  However that does not
> change the fact that this is still a workaround for the legacy?? ftp proxy server.
> Otherwise, the server would not have allowed reserved characters within the
> username like it does now :)

Just to be clear (I have the impression to be the only one with such a FTP proxy
server), here's an example on how to use the FTP proxy:

bash % ftp ftpproxy 8028
ftp> user anonymous@ftp.kde.org
password:
ftp> 

Then you're connected to ftp.kde.org, and you can work transparently, as if you
would have started directly with "ftp ftp.kde.org". This is how the ftp proxy
server works, and it is really a FTP server.

To be able to use it in Konqueror, I found 2 ways:
- use URL's like ftp://anonymous%40ftp.kde.org@ftpproxy:8028, what I would call the
  boring way. Furthermore, it fails each time you change the view, because once
  typed to URL is reformatted as ftp://anonymous@ftp.kde.org@ftpproxy:8028, in
  the combo box, which is clearly a wrong URL, and the new view uses it.
- hack kio_ftp so that:
    . redirect connection to the FTP proxy server/port
    . change "user <login>" command to "user <login>@<host>:<port>" as you would
      do with a command line ftp program.
  After that, you can use your FTP connection as a classical one, so no more changes
  in kio_ftp. The big advantage is that on application side (Konqueror), you only
  handle simple URL's like ftp://ftp.kde.org, no more problem with '@' encoding, ...

But I agree that this work for me (DeLeGate proxy server) and that it may not work
with other proxy tools (I don't know if other similar tools exist neither), I don't
think it's a standard. In my case however, it is _really_ useful.

These 2 solutions implies also that the proxy returned to the scheduler for a FTP
request is ftp and not http, leading to the second point (and the changes I made
to KProtocolManager).

> That is why we are going to have a new config dialog for configuring proxies very
> soon :)

Good idea.

> > - This won't work with auto-proxy configuration, which is my case, because
> > what you propose implies to use manual proxy configuration, an auto-proxy
> > will override everything, and the auto-proxy will of course redirect you to
> > the classical HTTP proxy
> 
> Nope.  Perhaps I should have been a bit more clearer about this.  The scheduler,
> which manages the io-slaves, determines whether or not a proxy is supposed to
> be used for the current connection by looking at one overloaded function:
> ::slaveProtocol.  These functions determine which io-slave is the actual io-slave
> that should be used to retreive the request.  Usually, i.e. when no proxy useage
> is requested, this does not matter, but if proxy useage is necessary then the most
> common setup is to route requests over the http io-slave since most proxy servers
> communicate over HTTP.  And this is where the problem comes in.  In the two overloaded
> functions, we have hard-coded the io-slave to be "http" whenever an FTP connection
> is requested instead of honoring what the user-setup.  In other words we completely ignore
> the fact that people such as yourself might have direct FTP proxy servers as well.  This
> is what my patch fixes.  It simply changes this hard-coded "http" limitation and instead
> determines the io-slave to use from the "protocol" of the actual proxy server URL.

OK, I looked at the recent code (revision 1.95 of kprotocolmanager.cpp), and it still
won't work in my case, because the FTP proxy is not part of the auto-proxy script.
This script will return either DIRECT or a HTTP proxy, never the FTP proxy. That's
why I have to override the auto-proxy settings and to add the test before the switch
statement.
But I guess then it is more a local configuration problem, and the script should
be changed (unfortunately, I don't have acces to it, or maybe I should use a local
copy of it, hacked).

Another point is that those changes to KProtocolManager are useless if you don't
patch ftp.cc also, otherwise kio_ftp won't know how to handle a FTP proxy server.

Michael

-- 
------------------------------------------------------------------
Michael Goffioul		IMEC-DESICS-MIRA
e-mail: goffioul@imec.be	(Mixed-Signal and RF Applications)
Tel:    +32/16/28-8510		Kapeldreef, 75
Fax:    +32/16/28-1515		3001 HEVERLEE, BELGIUM
------------------------------------------------------------------
 
>> Visit http://master.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic