1.0.0 • Published 1 year ago

shellver v1.0.0

Weekly downloads
-
License
WTFPL
Repository
-
Last release
1 year ago

shellver

Servidor tipo shell para node.js basado en socket.io. Incluye cliente html.

Instalación

npm i -g shellver

Explicación

Shellver está pensado para (a) acelerar el desarrollo de aplicaciones cliente-servidor y (b) crear aplicaciones de escritorio basadas en javascript del servidor y del cliente.

Se puede usar castelog o javascript.

Uso

· Comando mínimo (levantar servidor y cliente):

shellver-server
  --password pass
  --port 9191

· Levantar servidor pero con cliente personalizado (facilitándole el directorio estático principal):

shellver-server
  --password pass
  --port 9191
  --app-directory cliente/personalizado

· Levantar servidor pero con cliente personalizado con url de apertura personalizada:

shellver-server
  --password pass
  --port 9191
  --app-directory cliente/personalizado
  --app-url-path fichero/personalizado

· Levantar servidor sin cliente (usable para hacking, porque se deja al cliente único del servidor remotable, sin especificar):

shellver-server
  --password pass
  --port 9191
  --no-gui

· Levantar servidor y cliente habilitando traceos de la ejecución:

shellver-server
  --password pass
  --port 9191
  --trace

Guía de uso

La ayuda del programa la puedes ver usando shellver --help:

[ Welcome to «shellver-server» command line help ]

[ Usage: ]

~$   shellver-server
        --password $1        # required (text). also: -w
        --port $2            # required (number). also: -p
        --app-directory $3   # optional (text). also: -d
        --app-url-path $4    # optional (text). also: -u
        --app-extension $4   # optional (text). also: -x
        --no-gui             # optional (boolean). also: -n
        --trace              # optional (boolean). also: -t
        --help               # optional (boolean). also: -h

[ Notes: ]

  · If --no-gui is not specified, the gui is started
  · If --app-directory is not specified, the Shellver GUI app is set
    This means the app served as gui points to internal shellver gui source
    This means that changing this parameter, you can emulate your own desktop apps
  · If --app-url-path is not specified, the root "/" is set
    This means the app is opened on browser with "/" as appendix
    This means it will fallback automatically to the "/index.html" if so
  · If --app-extension is not specified, no file is loaded before server and socket connections
    This means if it is specified, the file is loaded as app extension
    This app_extension must be a js module that exports a function.
    This function is called.
  · If --trace is specified, it shows logs for each method and function run
  · If --help is specified, it shows this help and exits the program

Uso avanzado

Por completar:

  • documentar el uso de ShellverClient como API cliente del navegador.
  • documentar el uso de ShellverGui como componente vue2.
  • documentar el uso de ShellverGuiConsole como componente vue2.

¿Por qué?

Electron ha cambiado las APIs, por cuestiones de seguridad, y ahora te obliga a importar los módulos node.js de uno en uno.

Shellver te permite, sin historias raras, usar node.js desde páginas HTML.

Puede usarse también como una herramienta de control remoto, donde inicias shellver-server en un puerto, y en un segundo comando, inicias shellver-client (desde otra máquina) para conectarse a él y comunicarse. Pero tampoco era la idea del proyecto, le tendría que agregar algunas funciones para dejarlo más fácil. Quizá más adelante.