Sample script showing how to do local port forwarding over paramiko.
This script connects to the requested SSH server and sets up local port forwarding (the openssh -L option) from a local port through a tunneled connection to a destination reachable from the SSH server machine.
Called to clean up an individual request.
Return socket file number.
Interface required by select().
Finish one request by instantiating RequestHandlerClass.
Get the request and client address from the socket.
May be overridden.
Handle an error gracefully. May be overridden.
The default is to print a traceback and continue.
Handle one request, possibly blocking.
Respects self.timeout.
Called if no new request arrives within self.timeout.
Overridden by ForkingMixIn.
Start a new thread to process the request.
Same as in BaseServer but as a thread.
In addition, exception handling is done here.
Handle one request at a time until shutdown.
Polls for shutdown every poll_interval seconds. Ignores self.timeout. If you need to do periodic tasks, do them in another thread.
Called by constructor to activate the server.
May be overridden.
Called by constructor to bind the socket.
May be overridden.
Called to clean-up the server.
May be overridden.
Stops the serve_forever loop.
Blocks until the loop has finished. This must be called while serve_forever() is running in another thread, or it will deadlock.
Called to shutdown and close an individual request.
Verify the request. May be overridden.
Return True if we should proceed with this request.