Share your ICR or bash session with other users on LAN


The bash_chat.cr program allows multiple users to connect to a single server process like a long running interactive bash session or any other program which runs on the command line and do not expect a real tty (e.g. top).

All input from connected clients is sent to the server process and to all other connected clients. The output from the server process is sent to all clients. So you can chat on the bash or even better on the ICR prompt with other users. Coloured output from ICR seems to work.

$ icr
127.0.0.1:56334 Client sent:
icr(0.34.0) >
puts “hello”
127.0.0.1:56334 Client sent: puts “hello”
puts “hello”
icr(0.34.0) > puts “hello”
hello
=> nil

I hope this is useful.
Have fun with crystal :slight_smile:
BR,
Peter

1 Like