An SSH SOCKS proxy disappears when its SSH connection ends. A supervisor can restart that connection, but it cannot resume every website request that was using the old stream.

For an already working SSH setup, autossh can supervise a dynamic forward while OpenSSH detects an unresponsive server:

autossh -M 0 -N -o ServerAliveInterval=30 -o ServerAliveCountMax=3 -o ExitOnForwardFailure=yes -D 127.0.0.1:1080 [email protected]

-M 0 disables autossh's separate monitoring-port mechanism. It relies on SSH exiting so the supervisor can react. The server-alive options supply an SSH-level liveness check; they do not request a page from every destination you use.

Keep initial setup visible until authentication and forwarding work. Autossh's background behavior differs from plain SSH's -f: unattended launch cannot stop to ask for a password or key passphrase. Its documented startup gate can also distinguish an immediate setup failure from a later broken session.

After reconnection, the local listener can become available again. Applications may still need to retry their own failed operations. An upload interrupted before receiving a response has an application-level outcome to resolve, not merely a missing tunnel to restart.

Finally, a healthy SSH transport does not prove that the gateway can reach a particular website. Separate supervision of the tunnel from monitoring of the job using it.

Artiglyn mynjee