You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Benjamin Piwowarski (JIRA)" <ji...@apache.org> on 2012/10/09 13:42:02 UTC

[jira] [Created] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Benjamin Piwowarski created VFS-440:
---------------------------------------

             Summary: [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
                 Key: VFS-440
                 URL: https://issues.apache.org/jira/browse/VFS-440
             Project: Commons VFS
          Issue Type: Improvement
            Reporter: Benjamin Piwowarski
            Priority: Minor
         Attachments: sftp-stream-proxy.diff

What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance

http://backdrift.org/transparent-proxy-with-ssh

for a use case.

This simulates a ProxyCommand where the command is run on a SSH host.
The patch also contains a test for the new functionality. 

Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
{code:java}
builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
builder.setProxyHost(opts, "gate.way.host");
builder.setProxyPort(opts, 22);
builder.setProxyOptions(opts, proxyOptions);
{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory resolved VFS-440.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.1
         Assignee: Gary Gregory

Thank you BP!
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485807#comment-13485807 ] 

Gary Gregory commented on VFS-440:
----------------------------------

My "mvn clean test" loop has iterated 47 times without a hang with the v8 patch.

The SFTP tests always do not clean up perfectly with output like:

{noformat}
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
created threads still running:
#1: main        pool-12-thread-1        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#2: main        pool-11-thread-1        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        pool-12-thread-2        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#4: main        pool-12-thread-3        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#5: main        pool-12-thread-4        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
{noformat}

I will commit based no hang and other the confidence expresed in other comments.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v7.diff

Patch v7 includes SftpStreamProxy. 

I left the changes in PermissionsTests.java in the effort of cleaning up output of Sftp tests: it just removes a System.err.println
- System.err.println(file.setReadable(true, true));
+ file.setReadable(true, true);
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Comment: was deleted

(was: This might solve the hanging problem - not sure since I haven't had this bug while running mvn test.)
    
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485622#comment-13485622 ] 

Gary Gregory commented on VFS-440:
----------------------------------

FYI: I committed the PermissionsTests change. Thank you. Testing v7 and reviewing...

commit -m "Remove System.err.println." C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java
    Sending        C:/svn/org/apache/commons/trunks-proper/vfs/core/src/test/java/org/apache/commons/vfs2/test/PermissionsTests.java
    Transmitting file data ...
    Committed revision 1402988.

                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485818#comment-13485818 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Keep 'em coming :)
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated VFS-440:
-----------------------------

    Attachment: sftp-stream-proxy-v4.diff

Benjamin,

I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below.

Questions:

1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something?

2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it?

Gary

                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy.diff

Patch with new functionality and test
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485118#comment-13485118 ] 

Gary Gregory commented on VFS-440:
----------------------------------

I attached v5 of the patch.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486131#comment-13486131 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

@Ralph

This might be related to the fact that pom.xml was not committed before - in my first tests, it resulted in this hang.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484941#comment-13484941 ] 

Benjamin Piwowarski edited comment on VFS-440 at 10/26/12 2:15 PM:
-------------------------------------------------------------------

Gary, here are the answers to your questions:

1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 

2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections;

3. SftpStreamProxy does not rely on sockets - hence it does not have one.

I reviewed the changes in patch v4 and I have no special comments.

Benjamin
                
      was (Author: bpiwowar):
    Gary, here are the answers to your questions:

1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 

2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections;

3. SftpStreamProxy does not rely on sockets - hence it does not have one.

Benjamin
                  
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482109#comment-13482109 ] 

Gary D. Gregory edited comment on VFS-440 at 10/23/12 4:44 AM:
---------------------------------------------------------------

Thank you for the patch and sorry it has taken me so long to take a look.

I just started to review the patch, but it would be helpful if it did NOT contain ANY formatting changes. That makes the while process take longer. So, if you can attach a patch that contains the semantic changes only, this will all go faster.

One thing that I noticed in private static void connect(String name, final InputStream in, final OutputStream out, final ExitCallback callback):

{noformat}
+                catch (SshException ex)
+                {
+
+                }
{noformat}

That's probably not great unless I am missing something.

Also, do not hesitate to comment the code some more, that helps too :)

Thank you,
Gary
                
      was (Author: garydgregory):
    Thank you for the patch and sorry it has taken me so long to take a look.

I just started to review the patch, but it would be helpful if it did NOT contain ANY formatting changes. That makes the while process take longer. So, if you can attach a patch that contains the semantic changes only, this will all go faster.

One thing that I noticed in private static void connect(String name, final InputStream in, final OutputStream out, final ExitCallback callback):

+                catch (SshException ex)
+                {
+
+                }

That's probably not great unless I am missing something.

Also, do not hesitate to comment the code some more, that helps too :)

Thank you,
Gary
                  
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486127#comment-13486127 ] 

Ralph Goers commented on VFS-440:
---------------------------------

FWIW, I ran mvn site to look at the checkstyle output and the build hung on SftpProviderTestCase.  When I ran mvn clean install it succeeded but had the messages noted above.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484930#comment-13484930 ] 

Gary Gregory edited comment on VFS-440 at 10/26/12 2:00 PM:
------------------------------------------------------------

Benjamin,

I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below.

Questions:

1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something?

2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it?

3. SftpStreamProxy getSocket() returns null, I think this warrants a comment.

Gary

                
      was (Author: garydgregory):
    Benjamin,

I've started a code review and made a couple of changes. See sftp-stream-proxy-v4.diff. But I got stuck on the questions below.

Questions:

1. SftpStreamProxy keeps a session that is never initialized but is used in close(), which looks like it will cause an NPE. Am I missing something?

2. SftpStreamProxy used to keep a JSch but did not use it, so I removed it. Did you intend to use it?

Gary

                  
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated VFS-440:
-----------------------------

    Attachment: sftp-stream-proxy-v5.diff

We are getting close! The remaining issue is the test is not cleaning up after itself. This affects all the patches I tested: v3, v4 and v5:

{noformat}
-------------------------------------------------------
With V3 patch:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
Sftp server started on port 64349
true
created threads still running:
#1: main        NioProcessor-2  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#2: main        pool-1-thread-1 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#4: main        Thread-2        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#5: main        NioProcessor-3  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#6: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#7: main        Thread-4        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#8: main        NioProcessor-4  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#9: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#10: main       Thread-6        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#11: main       pool-2-thread-4 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#12: main       Thread-11       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#13: main       Thread-27       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#14: main       Thread-28       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#15: main       Thread-29       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem

created threads still running:
#1: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session

Tests run: 87, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.693 sec

-------------------------------------------------------
With V4 patch:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
Sftp server started on port 64466
true
created threads still running:
#1: main        NioProcessor-2  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#2: main        pool-1-thread-1 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#4: main        Thread-2        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#5: main        NioProcessor-3  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#6: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#7: main        Thread-4        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#8: main        NioProcessor-4  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#9: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#10: main       Thread-6        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#11: main       pool-2-thread-4 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#12: main       Thread-11       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#13: main       Thread-27       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#14: main       Thread-28       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#15: main       Thread-29       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem

created threads still running:
#1: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session

Tests run: 87, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 13.981 sec

-------------------------------------------------------
With V5 patch:

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
Sftp server started on port 64522
true
created threads still running:
#1: main        NioProcessor-2  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#2: main        pool-1-thread-1 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#4: main        Thread-2        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#5: main        NioProcessor-3  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#6: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#7: main        Thread-4        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#8: main        NioProcessor-4  not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#9: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#10: main       Thread-6        not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#11: main       pool-2-thread-4 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#12: main       Thread-11       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#13: main       Thread-27       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#14: main       Thread-28       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#15: main       Thread-29       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem

Tests run: 87, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 14.27 sec
{noformat}

                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482109#comment-13482109 ] 

Gary D. Gregory commented on VFS-440:
-------------------------------------

Thank you for the patch and sorry it has taken me so long to take a look.

I just started to review the patch, but it would be helpful if it did NOT contain ANY formatting changes. That makes the while process take longer. So, if you can attach a patch that contains the semantic changes only, this will all go faster.

One thing that I noticed in private static void connect(String name, final InputStream in, final OutputStream out, final ExitCallback callback):

+                catch (SshException ex)
+                {
+
+                }

That's probably not great unless I am missing something.

Also, do not hesitate to comment the code some more, that helps too :)

Thank you,
Gary
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary D. Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13473158#comment-13473158 ] 

Gary D. Gregory commented on VFS-440:
-------------------------------------

Thank you for the submission, I'll take a look this weekend.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13472282#comment-13472282 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

By the way, I had to lower the version of org.bouncycastle.bcprov-jdk15on to 1.46 (this is because sshd-core was downgraded to 0.7.0, svn commit 1395117, but bcprov remained on 1.47)
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment:     (was: sftp-stream-proxy-v8.diff)
    
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13483984#comment-13483984 ] 

Benjamin Piwowarski edited comment on VFS-440 at 10/25/12 8:48 AM:
-------------------------------------------------------------------

The patch v3 should solve the hanging problem my closing the SFTP connection link after each series of tests.
                
      was (Author: bpiwowar):
    This should solve the hanging problem my closing the SFTP connection link after each series of tests.
                  
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482603#comment-13482603 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Hi Benjamin,

Thank you, the new patch is easier to look at.

When I test the build with "mvn test", it hangs, and I see the following on the console:

{noformat}
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
Sftp server started on port 63772
true
created threads still running:
#1: main        NioProcessor-17 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#2: main        pool-11-thread-1        not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#4: main        Thread-24       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#5: main        NioProcessor-13 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#6: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#7: main        Thread-26       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#8: main        NioProcessor-14 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#9: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#10: main       Thread-28       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#11: main       NioProcessor-15 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#12: main       Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#13: main       Thread-30       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#14: main       Thread-33       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#15: main       Thread-49       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#16: main       Thread-50       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#17: main       Thread-51       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem

created threads still running:
#1: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#2: main        NioProcessor-17 not_a_daemon    class java.util.concurrent.ThreadPoolExecutor$Worker
#3: main        from nc daemon  class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$7
#4: main        to nc   daemon  class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$7
#5: main        Connect thread localhost session        daemon  class com.jcraft.jsch.Session
#6: main        Thread-55       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
#7: main        Thread-57       not_a_daemon    class org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase$MySftpSubsystem
{noformat}

But... I am on Windows. My set up is:

Apache Maven 3.0.4 (r1232337; 2012-01-17 03:44:56-0500)
Maven home: C:\Java\apache-maven-3.0.4\bin\..
Java version: 1.6.0_35, vendor: Sun Microsystems Inc.
Java home: C:\Program Files\Java\jdk1.6.0_35\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows 7", version: "6.1", arch: "amd64", family: "windows"

Is the new test platform independent?

If not, it should be skipped for Windows and if run, it should return an error.

Is the issue that the embedded SFTP server is trying to run the nc command (and there is nc.exe on Windows)?
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484941#comment-13484941 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

Gary, here are the answers to your questions:

1. The session should be from the connect - this is why it is not implemented. Strange that I never saw an error message coming from there. 

2. No, the JSch instance was a left over from early implementation - we now rely on Sftp connection mechanism to avoid having two different systems to configure SSH connections;

3. SftpStreamProxy does not rely on sockets - hence it does not have one.

Benjamin
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Ralph Goers (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485660#comment-13485660 ] 

Ralph Goers commented on VFS-440:
---------------------------------

Gary, I doubt that this patch is causing that simply because Gump has been failing for quite some time in the SFTP tests on a timeout.  See http://vmgump.apache.org/gump/public/apache-commons/commons-vfs2-test/gump_work/build_apache-commons_commons-vfs2-test.html.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486140#comment-13486140 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Please make sure you have the latest from trunk. I had forgotten to commit pom.xml.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13486121#comment-13486121 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Resovled as of: Committed revision 1403405.

I had forgotten to commit pom.xml.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Assignee: Gary Gregory
>            Priority: Minor
>              Labels: proxy, sftp
>             Fix For: 2.1
>
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485027#comment-13485027 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Ok, It's clear now. Thanks. 
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v2.diff

Cleaned up patch with more comments
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v3.diff

This should solve the hanging problem my closing the SFTP connection link after each series of tests.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485533#comment-13485533 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Patch v6 is missing SftpStreamProxy and therefore does not compile. The patch also changes PermissionsTests which previous versions did not touch IIRC. Please resubmit.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482663#comment-13482663 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

Yes, the test should be platform independent (the nc command is built it into the SSH test server, so it shouldn't matter whether it is run on Windows or not). I will try latter to see what might be wrong. Can you see how many tests have been run?
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v6.diff

Patch v6 cleans up properly the tests by shutting down the SFtp server. I tried a better solution, but it seems that some resources (files) are freed much latter.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v8.diff

This might solve the hanging problem - not sure since I haven't had this bug while running mvn test.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff, sftp-stream-proxy-v8.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484962#comment-13484962 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

Just to be sure:

- JSch jsch should be removed
- in connect, the "final Session" should be removed so that we use the member variable "session" and not a local one (and that the session can be properly closed)
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485638#comment-13485638 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

Running and no issues so far.

However, I think there might be issues (but they are not related to this patch) due to the fact that at least
- FileObject relies on finalize;
- getChannel() in SftpFileSystem can return channels that are not closed all the time

In fact, closing the Sftp server does close many dandling sessions (observed in the previous version of the patch). You could also use                 

    Server.stop(true);

in SftpProviderTestCase to force the server to kill all the sessions.

When I have some free time I can look at that (at least the getChannel() issue), but again I think this patch does not make things worse or better with that respect.


                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485623#comment-13485623 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Ok, now I am in weird territory.

This works reliably: "mvn -Dtest=org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase test"

But this hung once: "mvn clean test". I killed the Maven JVM and that left the JVM running the test running, which I killed separately.

I ran "mvn test" (no clean) and it passed.

I ran again "mvn clean test" and it passed.

I'm going to run "mvn clean test" in a loop and see if it hangs again.

Can you try too?

Thank you,
Gary
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484673#comment-13484673 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Yep, it builds and tests OK for me now. Thank you. I'll take sometime between tomorrow and the weekend to review it more carefully.

Gary
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13484958#comment-13484958 ] 

Gary Gregory commented on VFS-440:
----------------------------------

So the session ivar be removed, check?
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v8.diff

This might solve the hanging problem - not sure since I haven't had this bug while running mvn test.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485638#comment-13485638 ] 

Benjamin Piwowarski edited comment on VFS-440 at 10/28/12 3:03 PM:
-------------------------------------------------------------------

Running and no issues so far (apart from 1 error in running org.apache.commons.vfs2.provider.ram.test.RamProviderTestCase)

However, I think there might be issues (but they are not related to this patch) due to the fact that at least
- FileObject relies on finalize;
- getChannel() in SftpFileSystem can return channels that are not closed all the time

In fact, closing the Sftp server does close many dandling sessions (observed in the previous version of the patch). You could also use                 

    Server.stop(true);

in SftpProviderTestCase to force the server to kill all the sessions.

When I have some free time I can look at that (at least the getChannel() issue), but again I think this patch does not make things worse or better with that respect.

                
      was (Author: bpiwowar):
    Running and no issues so far.

However, I think there might be issues (but they are not related to this patch) due to the fact that at least
- FileObject relies on finalize;
- getChannel() in SftpFileSystem can return channels that are not closed all the time

In fact, closing the Sftp server does close many dandling sessions (observed in the previous version of the patch). You could also use                 

    Server.stop(true);

in SftpProviderTestCase to force the server to kill all the sessions.

When I have some free time I can look at that (at least the getChannel() issue), but again I think this patch does not make things worse or better with that respect.


                  
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485646#comment-13485646 ] 

Benjamin Piwowarski commented on VFS-440:
-----------------------------------------

I will have a second look at it latter, but I don't think the problem comes from the new code (well, not directly at least) but rather than resources are not freed by VFS.

It seems to be related to the thread that forward streams from the Sftp server to the client.
I could force all those threads to be killed at the end of the test but it seems to be against testing purpose. Tell me what you think.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Benjamin Piwowarski (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Benjamin Piwowarski updated VFS-440:
------------------------------------

    Attachment: sftp-stream-proxy-v7-bis.diff

Patch v7-bis is v7 without the change in PermissionsTests.java
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13482666#comment-13482666 ] 

Gary Gregory commented on VFS-440:
----------------------------------

Sadly no.
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (VFS-440) [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)

Posted by "Gary Gregory (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/VFS-440?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13485642#comment-13485642 ] 

Gary Gregory commented on VFS-440:
----------------------------------

The build hangs in the test on the 9th invocation of "mvn clean test" :(

Here is the thread dump:

{noformat}
Running org.apache.commons.vfs2.provider.sftp.test.SftpProviderTestCase
2012-10-28 11:07:17
Full thread dump Java HotSpot(TM) 64-Bit Server VM (20.10-b01 mixed mode):

"Thread-10" prio=6 tid=0x0000000009ebe800 nid=0x1b70 runnable [0x000000000ceff000]
   java.lang.Thread.State: RUNNABLE
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:220)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        - locked <0x00000007dc13df80> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        - locked <0x00000007dc13df80> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.codehaus.plexus.util.cli.StreamPumper.run(StreamPumper.java:129)

"Thread-9" prio=6 tid=0x0000000007f90800 nid=0x1b3c runnable [0x000000000cdff000]
   java.lang.Thread.State: RUNNABLE
        at java.io.FileInputStream.readBytes(Native Method)
        at java.io.FileInputStream.read(FileInputStream.java:220)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:317)
        - locked <0x00000007dc132108> (a java.io.BufferedInputStream)
        at sun.nio.cs.StreamDecoder.readBytes(StreamDecoder.java:264)
        at sun.nio.cs.StreamDecoder.implRead(StreamDecoder.java:306)
        at sun.nio.cs.StreamDecoder.read(StreamDecoder.java:158)
        - locked <0x00000007dc13b188> (a java.io.InputStreamReader)
        at java.io.InputStreamReader.read(InputStreamReader.java:167)
        at java.io.BufferedReader.fill(BufferedReader.java:136)
        at java.io.BufferedReader.readLine(BufferedReader.java:299)
        - locked <0x00000007dc13b188> (a java.io.InputStreamReader)
        at java.io.BufferedReader.readLine(BufferedReader.java:362)
        at org.codehaus.plexus.util.cli.StreamPumper.run(StreamPumper.java:129)

"ThreadedStreamConsumer" prio=6 tid=0x0000000007f90000 nid=0x1858 waiting on condition [0x000000000bcdf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000007dc0fe2a0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
        at org.apache.maven.plugin.surefire.util.internal.Java15BlockingQueue.take(Java15BlockingQueue.java:41)
        at org.apache.maven.plugin.surefire.booterclient.output.ThreadedStreamConsumer$Pumper.run(ThreadedStreamConsumer.java:68)
        at java.lang.Thread.run(Thread.java:662)

"resolver-4" daemon prio=6 tid=0x000000000b4d1800 nid=0x1930 waiting on condition [0x000000000bbdf000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000078312a418> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:662)

"resolver-3" daemon prio=6 tid=0x000000000b539800 nid=0x260c waiting on condition [0x000000000aa6f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000078312a418> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:662)

"resolver-2" daemon prio=6 tid=0x000000000a2d9000 nid=0x2414 waiting on condition [0x000000000991f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000078312a418> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:662)

"resolver-1" daemon prio=6 tid=0x000000000aea0000 nid=0x4a4 waiting on condition [0x000000000981f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x000000078312a418> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:156)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:1987)
        at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:399)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:947)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
        at java.lang.Thread.run(Thread.java:662)

"Low Memory Detector" daemon prio=6 tid=0x0000000006d10800 nid=0x1944 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" daemon prio=10 tid=0x0000000006d01000 nid=0x29b8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" daemon prio=10 tid=0x0000000006ceb800 nid=0x19ec waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" daemon prio=10 tid=0x000000000052f000 nid=0x1a80 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" daemon prio=10 tid=0x0000000006ce4800 nid=0x1c34 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" daemon prio=8 tid=0x000000000052d000 nid=0xd98 in Object.wait() [0x0000000006c8f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000007832e7818> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
        - locked <0x00000007832e7818> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)

"Reference Handler" daemon prio=10 tid=0x0000000000526000 nid=0x29e8 in Object.wait() [0x0000000006b8f000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000007832e77b0> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:485)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
        - locked <0x00000007832e77b0> (a java.lang.ref.Reference$Lock)

"main" prio=6 tid=0x000000000026c800 nid=0x1cc0 runnable [0x00000000027ae000]
   java.lang.Thread.State: RUNNABLE
        at java.lang.ProcessImpl.waitFor(Native Method)
        at org.codehaus.plexus.util.cli.CommandLineUtils$1.call(CommandLineUtils.java:173)
        at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:114)
        at org.codehaus.plexus.util.cli.CommandLineUtils.executeCommandLine(CommandLineUtils.java:88)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:280)
        at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:116)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:740)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAllProviders(AbstractSurefireMojo.java:682)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:648)
        at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:586)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

"VM Thread" prio=10 tid=0x000000000051d800 nid=0x2850 runnable

"GC task thread#0 (ParallelGC)" prio=6 tid=0x0000000000478000 nid=0x13f0 runnable

"GC task thread#1 (ParallelGC)" prio=6 tid=0x000000000047a000 nid=0x2788 runnable

"GC task thread#2 (ParallelGC)" prio=6 tid=0x000000000047b800 nid=0x1f48 runnable

"GC task thread#3 (ParallelGC)" prio=6 tid=0x000000000047d800 nid=0xe9c runnable

"VM Periodic Task Thread" prio=10 tid=0x0000000006d21000 nid=0x2a2c waiting on condition

JNI global references: 1713

Heap
 PSYoungGen      total 133824K, used 120489K [0x00000007d6560000, 0x00000007df9d0000, 0x0000000800000000)
  eden space 121664K, 89% used [0x00000007d6560000,0x00000007dcf2d490,0x00000007ddc30000)
  from space 12160K, 99% used [0x00000007de120000,0x00000007decfd2f0,0x00000007ded00000)
  to   space 13120K, 0% used [0x00000007ded00000,0x00000007ded00000,0x00000007df9d0000)
 PSOldGen        total 85248K, used 6877K [0x0000000783000000, 0x0000000788340000, 0x00000007d6560000)
  object space 85248K, 8% used [0x0000000783000000,0x00000007836b74e0,0x0000000788340000)
 PSPermGen       total 32576K, used 32443K [0x0000000763c00000, 0x0000000765bd0000, 0x0000000783000000)
  object space 32576K, 99% used [0x0000000763c00000,0x0000000765baeeb0,0x0000000765bd0000)
{noformat}
                
> [SFTP] Stream (e.g. netcat) proxy for Sftp file system (aka ProxyCommand)
> -------------------------------------------------------------------------
>
>                 Key: VFS-440
>                 URL: https://issues.apache.org/jira/browse/VFS-440
>             Project: Commons VFS
>          Issue Type: Improvement
>            Reporter: Benjamin Piwowarski
>            Priority: Minor
>              Labels: proxy, sftp
>         Attachments: sftp-stream-proxy.diff, sftp-stream-proxy-v2.diff, sftp-stream-proxy-v3.diff, sftp-stream-proxy-v4.diff, sftp-stream-proxy-v5.diff, sftp-stream-proxy-v6.diff, sftp-stream-proxy-v7-bis.diff, sftp-stream-proxy-v7.diff
>
>
> What I propose is to add the possibility to connect to a remote SSH server through an SSH connection stream (instead of an HTTP or SOCKS proxy). See for instance
> http://backdrift.org/transparent-proxy-with-ssh
> for a use case.
> This simulates a ProxyCommand where the command is run on a SSH host.
> The patch also contains a test for the new functionality. 
> Example of use (with the netcat command nc -q 0 HOSTNAME PORT)
> {code:java}
> builder.setProxyType(opts, SftpFileSystemConfigBuilder.PROXY_STREAM);
> builder.setProxyCommand(opts, SftpStreamProxy.NETCAT_COMMAND);
> builder.setProxyHost(opts, "gate.way.host");
> builder.setProxyPort(opts, 22);
> builder.setProxyOptions(opts, proxyOptions);
> {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira