Skip to content

mbrostami/goshare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

42 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoShare

GoShare is a command line tool for sharing files through multiple relays.

Demo

goshare with two relays

Installation

Make sure you have Go installed on your system.
Clone the repository

git clone https://github.com/mbrostami/goshare.git

Build the binary

go build -o goshare

Run the binary

./goshare

Usage

Sharing files

To share a file, use the following command:

goshare share -f <path/to/file> -r relay1:2022 -r relay1:2030 

The above command gives you a key code that needs to be shared with receiver in order to download the file.

Receiving files

Use the following command to receive the file:

goshare receive -k KEY_CODE_FROM_SENDER

Server Configuration

To configure the server, you can provide the following options:

goshare relay --port 2202 --ip localhost

TLS enabled

Generate Certificate

Skip this step if you already have certificate.
You can use cert command to generate self-signed key.pem and cert.pem files.

goshare cert --host localhost --dst ./cert/

The above command will create two files in ./cert/ directory.

Enable TLS on server:

goshare relay --port 2202 --ip localhost --with-tls --cert-path ./cert/

Enable TLS on clients (sender and receiver):

goshare receive -k KEY_CODE_FROM_SENDER --with-tls 
goshare share -f <path/to/file> -r relay1:2022 -r relay2:2030 --with-tls

By default the above command will use system's root CA set. In other cases use ca-path as below:
Use ca-path to specify the CA's certificate that has been used to sign the server's self-signed certificate.

goshare receive -k KEY_CODE_FROM_SENDER --with-tls --ca-path ./cert/cert.pem 
goshare share -f <path/to/file> -r relay1:2022 -r relay2:2030 --with-tls --ca-path ./cert/cert.pem

To skip the certificate verification in clients, you can use --skip-verify option (NOT recommended)

Todo

  • STUN

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Send and receive files using multiple relays

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages