liuyug / ndrop

a File Transfer Tool.
MIT License
16 stars 1 forks source link

Detect nitroshare and send a file to it #1

Closed techtonik closed 4 years ago

techtonik commented 5 years ago

When running ndrop without --listen or --send argument, it is possible to wait for any server to appear, send the file to it and quit. Nitroshare server is sending UDP packets to port 40816 every 5 seconds or so.

$ tshark -f "udp port 40816" -T fields -e data.text -o data.show_as_text:TRUE
{"name":"SONiC","operating_system":"linux","port":"40818","uses_tls":false,"uuid":"{338229ac-fb13-46e3-a0cf-093867c1f161}"}
...

A listener can catch the first packet, extract IP and send a file to it.

P.S. It may worth to add nitroshare tag to the repository.

liuyug commented 5 years ago

do not send file before server appear. It do not know the destination.

A listener is the server peer that only receive files.

ghost commented 4 years ago

A listener is the server peer that only receive files.

Does it mean that for send file from same where ndrop --listen run as server I should create one more instance as client (ndrop --send) in separate terminal window?

liuyug commented 4 years ago

Yes. One instance is running ndrop --listen another instance is running ndrop --send

ghost commented 4 years ago

OK, but what would happen if running ndrop --send instance would send /tmp/100M.bin to running ndrop --listen instance (which use /tmp/ folder for receiving files by default) on same device?