https://github.com/friskisgit/cli-fileserver
Share files peer-to-peer in your terminal (cross-platform)
https://github.com/friskisgit/cli-fileserver
Last synced: 12 months ago
JSON representation
Share files peer-to-peer in your terminal (cross-platform)
- Host: GitHub
- URL: https://github.com/friskisgit/cli-fileserver
- Owner: FriskIsGit
- Created: 2024-02-18T19:18:58.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-04-07T00:53:17.000Z (about 2 years ago)
- Last Synced: 2025-05-16T21:14:56.240Z (about 1 year ago)
- Language: Rust
- Size: 105 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## CLI File Server
TCP-based file exchange program
### Features
- Downloads can be resumed at any time as long as the file is present in the filesystem
- Each packet is validated (if sent out of order or corrupt - the download will terminate)
- Current `progress`, `speed` and `ETA` are updated every packet and displayed
### Config
- having a config file is `not required` as long as command line parameters are provided
- config file is read down line by line so if a key is redefined again it'll be overwritten
- lines that don't start with any recognized config `key` are not parsed (can be used for comments)
- when running as `host` without an ip argument the host ip will be automatically assigned
Run `cargo r host` or `cargo r connect`
### Running
1. Rename `config-ex.txt` file to `config.txt`
2. Configure values for either a `host` or a `client` setup
3. Alternatively pass them as command line arguments
> Additional arguments:
-ip, --ip=10.0.0.3
-p, --port=5313
-aa, --auto-accept
### Usage
- file sharing: `share `, the other end should perform a `read`
- speedtest: `si` - downloading peer, `so` - uploading peer
- RTT (round trip time): `rtt 1` - any peer, `rtt 2` - other peer
- close connection (stream close): `shutdown`
### Code snippet
```rust
pub struct FilePacket<'r> {
pub transaction_id: u64,
pub chunk_id: u64,
pub file_bytes: &'r [u8],
}
```