I need a java application, with full source code, to create a SSH tunnel that redirects a remote port for local access. Use jcraft or other library to do this linux equivalent:
> ssh user@server -L <localPort>:<hostInRemoteLan>:<hostPort>
and also provide the functionnality to do the opposite: bring a local (lan) port accessible from a remote server.
I just need a java console application (no GUI stuff). Every parameter must not be hardcoded, it must be possible to specify everything from the command line. With this, I need an example application of two application behind LAN/firewall (no open ports) talking to each other with the help of a central server to establish the communication. The central server only has the port 22 (SSH) as available.