LiveChat is a sytem built upon express4/socket.io/babel which offers chatting functionality over HTTP.
The supported CLI commands are:
- exit - close server and exit cli
- quit - close cli but keep server open
- system comm - execute a system command
- restart - restart server and cli
- clear - clear cli output
- logs - view logs
- erase - erase logs
- say id msg - send message to a client identified by his socket.io id
- sayall msg - send message to all clients connected
- eval comm - send a command to be eval'd locally on client's pc
- refresh [clientId] - refresh all client browsers or a specific one
- help command - command(s) help
When no command is passed but a message is given, it's executed locally on the server
default commands prefix is '.', start all commands with this except the server-eval
There are several in-chat commands too:
- disconnect - Close WebSocket (which by default causes browser refresh in 5 seconds)
- admin pass - Login as admin through chat to unlock more commands
Current chat prefix is
!!
Inline commands also exist!!
$bBOLD$b,$iItalic$i,$uUnderline$u,$USR(username),$d(date)
escape them as
$\b
- When the server main files are changed, the server automatically reloads unless the environmental variable BLOCKRELOAD is passed,
Similarily, whenclient/JSfiles are edited they get converted to ES5 and served underclient/JS5, they get minified and Flow-compiled aswell,
Block the automatic rebuild with the BLOCKBUILD environmental variable. - The default serving path can be changed from
./clientto a custom one throughconfig.json - You can force
babelcompilation withnpm run buildbut this requires the package to be installed as--save-devand default standards to be followed. - The server works with the Node-builtin
clustermodule and communicates with each shard with anipcsocket (not redis!) - The server auto-restarts on fatal/syntax errors and abnormal quits and catches globally unhandled errors.
- Serving the special
.htmx/.htmlx/.jsx/.cssxfiles leads to the translation of@@\expression@@\expressions in them before serving. Appending a\(escape sequence) after the@@escapes the whole expression from being evaluated (like this example). - There are also the special
.xtml/.xtm/.xjs/.xcssfiles that get processed once at launch-time.
Note that these evaluations happen server-side!!
- The history of the last 50 messages posted is kept but discarded upon server restart. The max history size can be adjusted from the
config.jsonfile together with the passwords. - There's also a spam filter that disallows sending requests faster than 800ms, change threshold in
config.json