Packages

Simple echo server for testing SSH clients

Current section

Files

Jump to
ssh_echo lib ssh_daemon_channel.ex
Raw

lib/ssh_daemon_channel.ex

defmodule SSHDaemonChannel do
@moduledoc """
A macro wrapping `:ssh_daemon_channel` erlang behaviour with a default
implementation.
"""
defmacro __using__(_opts) do
quote do
@behaviour :ssh_daemon_channel
def init(_), do: {:ok, nil}
def handle_ssh_msg(_, state), do: {:ok, state}
def handle_msg(_, state), do: {:ok, state}
def terminate(_, _), do: :ok
defoverridable :ssh_daemon_channel
end
end
end