Thanks to visit codestin.com
Credit goes to github.com

Skip to content

bgwdotdev/beach

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

beach

Package Version Hex Docs

A library for serving a shore TUI over ssh.

Further documentation can be found at https://hexdocs.pm/beach.

Host Keys

Beach requires your provide ssh host keys for your application. You can create these by running the following command:

# this is only needed once
ssh-keygen -t ed25519 -f ssh_host_ed25519_key -N ''

Example

gleam add beach@1
import beach
import shore

pub fn main() {
  let exit = process.new_subject()
  let spec =
    shore.spec(
      init:,
      update:,
      view:,
      exit:,
      keybinds: shore.default_keybinds(),
      redraw: shore.on_timer(16),
    )
  let config =
    beach.config(
      port: 2222,
      host_key_directory: ".",
      auth: beach.auth_anonymous(),
      on_connect: fn(_connection, _shore) { Nil },
      on_disconnect: fn(_connection, _shore) { Nil },
      max_sessions: Some(1000),
    )
  let assert Ok(_) = beach.start(spec, config)
  process.sleep_forever()
}

// see shore for application implementation
ssh localhost -p 2222

About

Serve Shore TUIs over SSH

Resources

License

Stars

Watchers

Forks

Packages

No packages published