Crates.io | lancat |
lib.rs | lancat |
version | 0.3.0 |
source | src |
created_at | 2019-06-11 14:50:59.882309 |
updated_at | 2019-06-14 11:21:39.802309 |
description | lancat is a tool that extends the behaviour of cat linux utility to the LAN |
homepage | |
repository | |
max_upload_size | |
id | 140396 |
size | 32,271 |
lancat is a tool that extends the behaviour of cat
linux utility to the LAN.
It sends a multicast message for searching lancat listeners in the LAN,
then creates one-to-one tcp connection for each listener found in order to transfer the information
in a reliable way and without saturating the network.
lancat is a rust application. You can use the cargo package manager in order to install it.
$ cargo install lancat
If you have ~/.cargo/bin
in your PATH, you will be able to use lancat everywhere in your computer!
Supported on linux
and windows
, but can be works in others platforms.
It has two main modes: write to the LAN, and read from the LAN.
To write data to the LAN, run lancat
into write mode with w
:
$ lancat -w
hello lan
Furthermore, you can redirect the standard input from a file to write it into the LAN:
$ lancat -w < to_share.txt
To read data from the LAN, run lancat
into read mode with -r
:
$ lancat -r
=========== username - 192.168.1.35:43230 ===========
hello lan
In the case you want to send the incoming data to a certain file, you can redirect the standard output:
$ lancat -r -q > shared.txt
the -q
flag (also --quiet
) will avoid to write the user name line into the file.
By default lancat notifies to the LAN with your OS user name.
It is possbile to change this name with the -n
flag.
You can filter for writing or reading only for certain users:
$ lancat -w -u user1 user2
$ lancat -r -u user1 user2
In order to see which users are listening the lan, you can run lancat in search mode with -s
:
$ lancat -s
Found 'user1' at: 192.168.1.72:44435
Found 'user2' at: 192.168.1.72:44439
Found 'user3' at: 192.168.1.54:44432
To see all available options see the help: lancat --help
.
Sending a message filtering by user1:
$ echo "Hello user1" | lancat -w -u user1
Receiving messages filtering by user2:
$ lancat -r -q -u user2
Hello user1
Only users with names user1 and user2 will be able participate in the communication.
Sending a message to Juanito identifying us as Pepito:
$ echo "Hello Juanito, I'm Pepito" | lancat -w -n Pepito -u Juanito
Receiving messages intended for Juanito that only Pepito sends:
$ lancat -r -q -n Juanito -u Pepito
Hello Juanito, I'm Pepito