multiplexing or keepalive
When we talk about the HTTP protocol, some users could misunderstand multiplexing and keepalive. While keepalive means you can handle many requests in one connection, and it needs FIFO. Multiplexing seems an improvement on keepalive: one connection also holds many requests, but doesn’t need FIFO.
If you connect the remote server frequently, like git push many times, the multiplexing could help to save your time. Because it doesn’t need to establish a new TCP connection every time.
Configuration
Well, the OpenSSH supports multiplexing, and clients could share the connection with the Unix socket.
Just add the Controlpath under the old configuration.
1 | Host ali |
When you first connect to the server, a Unix socket file is automatically created in your ~/.ssh directory.
1 | ~ ❤ ls ~/.ssh |
This file could be used by other ssh clients who want to connect to the same server.
ControlPersist: Please note that if the
initial clientcloses, the other clients will be closed after that time (600s).
Since we use sshfs, we could combine it with OpenSSH multiplexing. By simply mounting a path, we don’t need to open a new console to stay connected.