I know you can use ssh to forward a local or remote port to another destination and port. So for example let's say I have this command:
ssh -L *:8443:10.0.0.1:443 user@10.0.0.2
So this allow to open a listening socket on the machine where the command is issued (let's say that its ip is 10.0.0.3
) on port 8443
. When some client connect to 10.0.0.3:8443
the packets flow through the ssh channel established between 10.0.0.3
and 10.0.0.2
then the ssh server on 10.0.0.2
forward the packets to the destination which is in this case 10.0.0.1:443.
I'm wondering if the server 10.0.0.2
can makes a permanent connection to 10.0.0.1:443
so that the connection 10.0.0.2:xxxxx -> 10.0.0.1:443
is opened once and never dropped. All the traffic coming from the clients connecting to 10.0.0.3:8443
should use this permanent channel.
So basically I don't want that when a new client connect to 10.0.0.3:8443
a new channel 10.0.0.2:xxxxx -> 10.0.0.1:443
is established. This prevent me from reusing the same session and invalidate a the request sent by another client after the first one.