im using the camel ftp component. 2.5 and have tried to open a connection to
a remote ftp
server via the proxy, but this doesn't work.I need to configure a
user@server proxy connection and im
not sure if i can resolve my problem with the apache commons ftp server.
I tried to start my java application with the following properties:
This post has NOT been accepted by the mailing list yet.
I use Camel 2.7.0 in the new project.
It is necessary to take away files with FTP servers. The component camel-ftp works well.
The component isn't able to pass through Squid proxy server.
It is used FTP over HTTP proxy.
Library FTP4J copes with this problem.
I have developed component FTP of the client constructed on library FTP4J.
FTP4J Version 1.6 - 2011/01/07.
I have added in FTP4J transfer socket timeout and storage of answer FTPReply in FTPClient.
In camel the component has added parameter "proxy".
It is a line url authorizations for proxy server.
If the scheme http is specified, we put HTTPTunnelConnector.
If the scheme ftp is specified, we put FTPProxyConnector.
If the scheme socks5 is specified, we put SOCKS5Connector.
If the scheme socks or socks4 is specified, we put SOCKS4Connector.
If the parameter "proxy" isn't specified, there is a direct connection to FTP server.
Ftp4j license does not allow embedding it in Camel.
I found a nasty bug. No checking disconnection.
I took the system of authorization on the proxy server. Created a new component for creating socket and several components of the authorization.
Created FTPClient heir of the project commons-net. Creating a socket replaced by a system of authorization.
I got a working authentication for FTP over HTTP proxy server.
If we will modify FTPClient component of the project commons-net, then a component camel-ftp will not change.
Can I release this code under a license Apache License?
> 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
> 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.
> ftpext://publicftpserver.com/download?ftpClient.proxyUrl=<a href="http://user:email@example.com:port/">http://user:password@...: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.
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);
> 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
> FtpEndpoint is created by setting the parameter component.
> replace the line
> 103: IntrospectionSupport.setProperties (client, ftpClientParameters);
> 111: IntrospectionSupport.setProperties (ftpClientConfig,
> 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.