[ 
https://issues.apache.org/jira/browse/CAMEL-12711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569792#comment-16569792
 ] 

ASF GitHub Bot commented on CAMEL-12711:
----------------------------------------

onderson commented on a change in pull request #2452: [CAMEL-12711] Add 
configuration property 'bindAddress' for SFTP
URL: https://github.com/apache/camel/pull/2452#discussion_r207785251
 
 

 ##########
 File path: 
components/camel-ftp/src/main/java/org/apache/camel/component/file/remote/SftpOperations.java
 ##########
 @@ -1074,4 +1097,64 @@ public synchronized boolean sendSiteCommand(String 
command) throws GenericFileOp
         // is not implemented
         return true;
     }
+
+    /*
+     * adapted from com.jcraft.jsch.Util.createSocket(String, int, int)
+     *
+     * added possibility to specify the address of the local network 
interface, against the
+     * connection should bind
+     */
+    static Socket createSocketUtil(final String host, final int port, final 
String bindAddress, final int timeout) {
+        Socket socket = null;
+        if (timeout == 0) {
+            try {
+                socket = bindAddress == null ? new Socket(host, port) : new 
Socket(InetAddress.getByName(host), port, InetAddress.getByName(bindAddress), 
0);
 
 Review comment:
   what you do is reasonably good as the class and method has default access 
modifers.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> SFTP: Cannot specify bind address of local network interface
> ------------------------------------------------------------
>
>                 Key: CAMEL-12711
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12711
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-ftp
>    Affects Versions: 2.22.0
>            Reporter: Felix Feisst
>            Priority: Major
>
> In an environment with multiple network interfaces, it might be necessary to 
> specify the address of the local interface, to which the SFTP connection 
> should bind. Unfortunately, this is not possible with the latest version of 
> camel-ftp.
>  
> A new URI parameter 'bindAddress' should be introduces which can then be set 
> to the IP-Address of the local network interface against which the SFTP 
> connection should bind.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to