Raxol.SSH.Server
(Raxol v2.3.0)
View Source
Serves a Raxol TEA application over SSH.
Each SSH connection gets its own Lifecycle process running the TEA app, with terminal I/O redirected through the SSH channel.
Usage
Raxol.SSH.serve(CounterExample, port: 2222)Then connect: ssh localhost -p 2222
Options
:port- Port to listen on (default: 2222):host_keys_dir- Directory for SSH host keys (default: "/tmp/raxol_ssh_keys"):max_connections- Maximum concurrent connections (default: 50)
Summary
Functions
Returns a specification to start this module under a supervisor.
Returns the current number of active connections.
Registers a new connection. Returns :ok or {:error, :max_connections}.
Unregisters a connection when it closes.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec connection_count(GenServer.server()) :: non_neg_integer()
Returns the current number of active connections.
@spec register_connection(GenServer.server()) :: :ok | {:error, :max_connections}
Registers a new connection. Returns :ok or {:error, :max_connections}.
@spec serve( module(), keyword() ) :: GenServer.on_start()
@spec start_link(keyword()) :: GenServer.on_start()
@spec unregister_connection(GenServer.server()) :: :ok
Unregisters a connection when it closes.