Seth Rothenberg · Nov 29, 2017

TCP adaptor + SSH Tunnel


We have one vendor who requires us to send data using TCP

through an SSH port forwarding tunnel that is set up in advance.

UNIX scripts maintain this, and the Ensemble interface uses a TCP Adapter.


I was thinking that Ensemble could maintain the SSH tunnel, 

which would improve our detecting of issues.


Has anyone done something like this?

I see that the  class %Net.SSH.Session has a method ForwardPort,

but it doesn't stand up the tunnel by itself.   Instead, it appears 

to return a handle into the tunnel.     It will work a bit differently.





• method ForwardPort(pRemoteHost As %String, pRemotePort As %Integer, ByRef pDevice As %String) as %Status

Forwards traffic via the SSH connection to a remote host/port. The traffic is sent via an XDEV device that is opened by ForwardPort() and passed back by reference via the pDevice parameter.


0 355
Discussion (1)2
Log in or sign up to continue

One approach would be to create a custom business service that manages an SSH connection by calling a command line SSH client similar to your existing UNIX scripts. It would start the connection when the production/business service starts, clean it up when the service is stopped, and can log errors in the Ensemble error log.