CLI app to send and receive files between two or more clients and a server. Clients can subscribe(listen) to specific channels and servers coordinate them (receive files and redirect them to their destination).
A simple protocol to enable the communication between client and server.
- Sending files:
-> <content-size> <file> <channel>
- Subscribing to channel:
listen <channel>
Click the image
Usage:
client-server [command]
Available Commands:
client Initialize a client
completion Generate the autocompletion script for the specified shell
help Help about any command
server Initialize the server
Flags:
-h, --help help for client-server
-t, --toggle Help message for toggle
To start the server with default options run ./client-server server
.
More options/flags:
Flags:
-c, --channels int Tells the number of channels to create. (default 3)
-h, --help help for server
-m, --max int Maximum supported filesize (B). (default 4096)
To send a file to the server on channel e.g (1) run:
./client-server client send --channel 1 ../foo.txt
To see additional flags and information run
./client-server client send --help
run:
./client-server client receive --channel 1
as usual help for the command is displayed by doing
./client-server client --help
The frontend serves as a reporting page where general information about the server is displayed:
- Current file and size being transmitted on each channel.
- Current clients listening over each channel.
- Amount of bytes transmitted since the last update on each channel.
- Line graph showing historic data of total concurrent clients.
- Filetypes transmitted.
The frontend running on port 5173
gets all this data from an API running on port 8080
by making a GET request to the /info
route. Said API is started alongside the server but they are different applications.
- net package.
- gin (API).
- cobra (CLI arguments).
- Vue.js (Front-end).
- Charts.js
- Bootstrap 5 (styling and css classes).