heiver

command module
v0.0.0-...-f9e80be Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2021 License: MIT Imports: 6 Imported by: 0

README


Logo

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}
  • Running in debug mode
❯ 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.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/your feature)
  3. Commit your Changes (git commit -m 'feat:Add some your feature')
  4. Push to the Branch (git push origin feature/your feature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Juan Christian - [email protected]

Project Link: https://github.com/HotPotatoC/heiver

Buy Me A Coffee

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
cmd
internal
pkg
tcp

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL