A simple Bi-Directional file transfer tool via a TCP socket.
Currently still in Work In Progress
Report Bug
Please Note
This project is currently not ready and not targeted for production use.
The aim of the heiver project is for me to learn the basics of networking and communicating through a TCP socket. For a more professional and well-worked file-sharing implementation, use croc instead. Heiver is heavily-inspired by croc
Todo
- Serve
- Upload file to the receiver
- Able to send a file to a different computer on the same network
- Auto update binary
- Security
- Dockerize(?)
- More soon...
Getting Started
Installation
Requires Go 1.12+
❯ GO111MODULE=on go get -v github.com/HotPotatoC/heiver
Usage
- Running up the heiver server
❯ heiver serve
INFO Waiting for sender... {"addr": "0.0.0.0:9500"}
INFO Press CTRL + C to exit {"addr": "0.0.0.0:9500"}
- Uploading a file to the server
❯ heiver upload -file my-file.zip
Uploading 100% |██████████████████████████████████████████████████████████████████| (115/115 MB, 80.392 MB/s)
Successfully uploaded file to the server.
Works with ./
, ../
and ~/
❯ heiver upload -file ../../../Downloads/my-file.zip
❯ heiver upload -file ~/Downloads/my-file.zip
Server side
INFO Accept my-file.zip (115.5 MB) ? [Y/n] {"from": "127.0.0.1:39010"}
INFO Waiting for client to finish uploading... {"from": "127.0.0.1:39010"}
INFO go1.15.2.linux-amd64.tar.gz (115.5 MB) has been received {"from": "127.0.0.1:45084", "bytes": 121083973}
❯ heiver serve -debug
DEBUG Running in DEBUG mode
DEBUG Starting server...
DEBUG creating TCP Listener
DEBUG successfully made TCP Listener
INFO Waiting for sender... {"addr": "[::]:9500"}
INFO Press CTRL + C to exit {"addr": "[::]:9500"}
DEBUG 127.0.0.1:45084 connected {"from": "127.0.0.1:45084"}
DEBUG file information: {Name:go1.15.2.linux-amd64.tar.gz ActualName:go1.15.2.linux-amd64.tar Extension:.gz PathToFile: Size:121149509}
DEBUG asking receiver for confirmation {"from": "127.0.0.1:45084"}
INFO Accept go1.15.2.linux-amd64.tar.gz (115.5 MB) ? [Y/n] {"from": "127.0.0.1:45084"}
DEBUG receiver accepted the file {"from": "127.0.0.1:45084"}
INFO Waiting for client to finish uploading... {"from": "127.0.0.1:45084"}
DEBUG finding duplicate files {"from": "127.0.0.1:45084"}
DEBUG no duplicate file found {"from": "127.0.0.1:45084"}
DEBUG creating file {"from": "127.0.0.1:45084"}
DEBUG copying file content from the client to the newly created file {"from": "127.0.0.1:45084"}
INFO go1.15.2.linux-amd64.tar.gz (115.5 MB) has been received {"from": "127.0.0.1:45084", "bytes": 121083973}
Contributing
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/your feature
)
- Commit your Changes (
git commit -m 'feat:Add some your feature'
)
- Push to the Branch (
git push origin feature/your feature
)
- Open a Pull Request
License
Distributed under the MIT License. See LICENSE
for more information.
Juan Christian - [email protected]
Project Link: https://github.com/HotPotatoC/heiver