Results 1 to 6 of 6

Thread: DefaultFtpSessionFactory and Proxy

  1. #1
    Join Date
    Jan 2011
    Posts
    14

    Default DefaultFtpSessionFactory and Proxy

    I need to FTP to a site through a proxy and I see that DefaultSftpSessionFactory supports a proxy but DefaultFtpSessionFactory does not.

    Questions:
    1) Why the inconsistency?
    2) Is there a way to get DefaultFtpSessionFactory to use a proxy
    3) If there is a way, how would I do it (other than "Just write your own version")?

  2. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    There is actually nothing inconsistent about it. The SFTP uses different library that has an explicit proxy setting where FTP uses commons-net which uses different mechanism to connect through proxy. You can read more here: http://wiki.apache.org/commons/Net/F...AskedQuestions. Scroll down to "Does FTPClient support FTP connections through an FTP proxy server?" as well as http://marc.info/?l=jakarta-commons-...7944806547&w=2

    Basically all you need to do is set two system properties before creating ApplicationContext.
    For example one way of doing it would be:
    Code:
    System.getProperties().put( "socksProxyPort", "1080");
    System.getProperties().put( "socksProxyHost" ,"proxy.host.address");
    ApplicationContext context = . . .

  3. #3
    Join Date
    Jan 2011
    Posts
    14

    Default

    Thanks for the info!

    Question: Won't this proxy anything that uses commons-net then? I only want the proxy for this one external FTP connection as I have other FTP connections to other internal servers that do not need to go through our proxy.

  4. #4
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    No, its per JVM instance unless other FTP connections are part of the same JVM instance.

  5. #5
    Join Date
    Jan 2011
    Posts
    14

    Default

    They will be part of the same JVM. I have multiple FTP connections to various servers (internal and external) occurring within the same execution.

    I'm looking at using the ProxyFtpSessionFactory that was in a previous post that you commented on:
    http://forum.springsource.org/showth...hannel-adapter

    If it works I think it would be a good addition to a future release of Spring Integration.

  6. #6
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    Could you please raise a JIRA Improvement request https://jira.springsource.org/browse/INT. We might have to change the underlying library if commons-net is not supporting it.

    Thanks

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •