You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by alexey-s <al...@mail.ru> on 2013/10/21 14:00:02 UTC
Re: FTP over Proxy
Good afternoon.
Let's go back to the history of the issue. The discussion was offered
functionality https://issues.apache.org/jira/browse/CAMEL-3845
Check the description FTPS component in http://camel.apache.org/ftp2.html
SFTP component uses this functionality.
What prevents the FTP component to pass through a proxy?
FtpEndpoint creates commons-net FTPClient.
GenericFileComponent create endpoint
endpoint = buildFileEndpoint (uri, remaining, parameters);
After creating the endpoint initialization of parameters
setProperties(endpoint, parameters);
The main component, commons-net FTPClient, not configurable.
We need to manually set SocketFactory.
It would be logical to make the identification of parameters for ftpClient
ftpClient.socketFactory=#soketFactory
ftpClient.proxy=#proxy
I posted on GitHub implementation of the system passing proxy.
https://github.com/alexey-su/camel-ftpext
This component recognizes the parameter ftpClient.proxyUrl
When you create an endpoint sets the desired soketFactory.
Examples
ftpext://publicftpserver.com/download?ftpClient.proxyUrl=http://user:password@proxy.domain.lan:port/
--
View this message in context: http://camel.465427.n5.nabble.com/FTP-over-Proxy-tp3314841p5741973.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: FTP over Proxy
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Good idea about that setProperties in default endpoint.
I logged a couple of tickets
https://issues.apache.org/jira/browse/CAMEL-6907
https://issues.apache.org/jira/browse/CAMEL-6908
On Fri, Oct 25, 2013 at 5:30 AM, alexey-s <al...@mail.ru> wrote:
> Hi
>
> The change is very small
>
> DefaultComponent object has a method
> protected void setProperties (Object bean, Map <String, Object>
> parameters) throws Exception
> It is necessary to repeat this method in DefaultEndpoint.
>
> Why is that? Used factory EndpointHelper owes its name to the tune
> DefaultEndpoint.
>
> FtpEndpoint is created by setting the parameter component.
>
> replace the line
> 103: IntrospectionSupport.setProperties (client, ftpClientParameters);
> 111: IntrospectionSupport.setProperties (ftpClientConfig,
> ftpClientConfigParameters);
> the challenge of the new method
> 103: setProperties (client, ftpClientParameters);
> 111: setProperties (ftpClientConfig, ftpClientConfigParameters);
>
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-over-Proxy-tp3314841p5742147.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen
Re: FTP over Proxy
Posted by alexey-s <al...@mail.ru>.
Hi
The change is very small
DefaultComponent object has a method
protected void setProperties (Object bean, Map <String, Object>
parameters) throws Exception
It is necessary to repeat this method in DefaultEndpoint.
Why is that? Used factory EndpointHelper owes its name to the tune
DefaultEndpoint.
FtpEndpoint is created by setting the parameter component.
replace the line
103: IntrospectionSupport.setProperties (client, ftpClientParameters);
111: IntrospectionSupport.setProperties (ftpClientConfig,
ftpClientConfigParameters);
the challenge of the new method
103: setProperties (client, ftpClientParameters);
111: setProperties (ftpClientConfig, ftpClientConfigParameters);
--
View this message in context: http://camel.465427.n5.nabble.com/FTP-over-Proxy-tp3314841p5742147.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: FTP over Proxy
Posted by Claus Ibsen <cl...@gmail.com>.
Hi
Sounds like a good idea to support this out of the box in camel-ftp.
You are welcome to submit a patch with your enhancement in the
camel-ftp component.
On Mon, Oct 21, 2013 at 2:00 PM, alexey-s <al...@mail.ru> wrote:
> Good afternoon.
>
> Let's go back to the history of the issue. The discussion was offered
> functionality https://issues.apache.org/jira/browse/CAMEL-3845
>
> Check the description FTPS component in http://camel.apache.org/ftp2.html
> SFTP component uses this functionality.
>
> What prevents the FTP component to pass through a proxy?
> FtpEndpoint creates commons-net FTPClient.
>
> GenericFileComponent create endpoint
> endpoint = buildFileEndpoint (uri, remaining, parameters);
>
> After creating the endpoint initialization of parameters
> setProperties(endpoint, parameters);
>
> The main component, commons-net FTPClient, not configurable.
> We need to manually set SocketFactory.
>
> It would be logical to make the identification of parameters for ftpClient
> ftpClient.socketFactory=#soketFactory
> ftpClient.proxy=#proxy
>
> I posted on GitHub implementation of the system passing proxy.
> https://github.com/alexey-su/camel-ftpext
>
> This component recognizes the parameter ftpClient.proxyUrl
> When you create an endpoint sets the desired soketFactory.
>
> Examples
>
> ftpext://publicftpserver.com/download?ftpClient.proxyUrl=http://user:password@proxy.domain.lan:port/
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/FTP-over-Proxy-tp3314841p5741973.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
--
Claus Ibsen
-----------------
Red Hat, Inc.
Email: cibsen@redhat.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen