Class: Microsandbox::SshServer
- Inherits:
-
Object
- Object
- Microsandbox::SshServer
- Defined in:
- lib/microsandbox/ssh.rb
Overview
A reusable SSH server endpoint for a sandbox, from Microsandbox::SshOps#prepare_server.
Each #serve_connection serves a single SSH transport over this process's
stdin/stdout — typically wired up by a parent SSH daemon via ForceCommand
or an inetd-style spawn. Mirrors the SshServer of the official SDKs.
Instance Method Summary collapse
-
#close ⇒ nil
Release the prepared server endpoint.
-
#initialize(native) ⇒ SshServer
constructor
A new instance of SshServer.
-
#serve_connection ⇒ nil
Serve one SSH connection over this process's stdin/stdout.
Constructor Details
#initialize(native) ⇒ SshServer
Returns a new instance of SshServer.
200 201 202 |
# File 'lib/microsandbox/ssh.rb', line 200 def initialize(native) @native = native end |
Instance Method Details
#close ⇒ nil
Release the prepared server endpoint. Idempotent.
214 215 216 217 |
# File 'lib/microsandbox/ssh.rb', line 214 def close @native.close nil end |
#serve_connection ⇒ nil
Serve one SSH connection over this process's stdin/stdout. Blocks until the session ends.
207 208 209 210 |
# File 'lib/microsandbox/ssh.rb', line 207 def serve_connection @native.serve_connection nil end |