Skip to content
Duncan McGreggor edited this page Aug 14, 2015 · 2 revisions

Below is a quick pass at a possible execution flow.

Browser -> Server:

  • User goes to try.lfe.io
  • YAWS serves static content and an appmod for try.lfe.io, as well as a REST service for an LFE shell
  • They are prompted to enter a user name for the given session (with a modal overlay)
  • The username is combined with the referrer IP address and an md5 hash is generated from these

Server:

  • The process table is searched for a shell process that has that md5 hash as its registered name; if one does not exist, it is created and registered
  • When the LFE shell is created, it does so using a restricted shell

Browser -> Server (cont'd):

  • The modal dialog goes away, bringing the console into focus and a prompt that reads "somename|lfe> "
  • The user enters code into the JS console at the prompt
  • The console sends the command to the try.lfe.io REST endpoint (e.g., http://try.lfe.io/api) also sending the referrer IP and username hash

Server:

  • The REST server does the usual routes dispatch to the appropriate LFE function
  • The LFE function looks up the user's LFE shell and sends it the user's command
  • The user's LFE shell attempts to execute the user's input and returns the results back to the LFE calling LFE function
  • The calling LFE function returns the result back to the REST server

Server -> Browser:

  • The REST server returns the result to jQuery running in the user's browser
  • jQuery displays the result in the console on the user's browser
  • If the user closes the window, their LFE shell is terminated
  • If the user is inactive and keeps the browser window open for longer than the timeout value, the LFE shell is terminated
  • Any text entered into the console with a disconnected LFE shell will cause the modal pop-up to prompt the user for a name so that a shell may be re-created
Clone this wiki locally