Skip to content
DocheinsteinPublic

About

A minimal command-line file transfer between peers in a local network, written in C++23.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

share

Simply send files or folders to another machine on the same local network. The receiver is identified by a short name. No need to type the IP address or a long identifier.

Compatible with Linux, macOS and Windows.

No external dependencies.

Written in C++23.

Example

On the receiving machine

# On the receiving machine
cd ~/Downloads
share recv

On the sending machine

share send Downloads report.pdf

If only one receiver is running on the local network, the name can even be omitted.

share send report.pdf

Usage

share - send files to another machine on the local network

Usage:
  share recv [name]                              wait for files, and save them into the current directory.
                                                 <name> defaults to the current directory's name.
  share send [<name>[@address:port]] <path>...   send files or directories to the receiver <name>.
                                                 The <name> can be omitted if there is exactly one
                                                 receiver in the network.
  share list                                     list the receivers on the network.

's', 'r' and 'l' are shortcuts for 'send', 'recv' and 'list'.
If the receiver's address and port are not specified, share figures them outby sending a discovery packet
over the network (on UDP port 47000).
  • share s, share r and share l are shortcuts for share send, share recv and share list.

Build

mkdir build
cd build
cmake ..
make

Installation

mkdir build
cd build
cmake ..
sudo make install

How it works

  1. share send broadcasts a UDP query on port 47000 to every interface (and to localhost).
  2. Each share recv answers with its name, its folder's name (for share list) and TCP port (47001, or another port if taken).
  3. The sender connects over TCP and streams the files

Security note: it is meant for trusted LANs. There is no encryption or authentication, so anyone on the network who knows (or lists) the name can drop files into the receiving folder while share recv is running.

License

Released under the MIT License.

About

A minimal command-line file transfer between peers in a local network, written in C++23.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages