code: def main(port=8222):
      
      loop = asyncio.get_event_loop()
  
      # Namespace exposed in the REPL.
      environ = {'hello': 'world'}
  
      # Start SSH server.
      def create_server():
          return MySSHServer(lambda: environ)
  
      print('Listening on :%i' % port)
      print('To connect, do "ssh localhost -p %i"' % port)
  
      loop.run_until_complete(
          asyncssh.create_server(create_server, '', port,
                                 server_host_keys=['/etc/ssh/ssh_host_dsa_key']))
  
      # Run eventloop.
      loop.run_forever()
docs: Example that starts the REPL through an SSH server.