Announcement Announcement Module
Collapse
No announcement yet.
DefaultFtpSessionFactory and Proxy Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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 = . . .

    Comment


    • #3
      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.

      Comment


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

        Comment


        • #5
          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.

          Comment


          • #6
            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

            Comment

            Working...
            X