项目作者: SkullTech

项目描述 :
A simple CLI client for peer-to-peer file or message sending. Written in Python
高级语言: Python
项目地址: git://github.com/SkullTech/Pearsend.git
创建时间: 2017-12-02T15:41:40Z
项目社区:https://github.com/SkullTech/Pearsend

开源协议:MIT License

下载


Pearsend

A simple CLI client for peer-to-peer file or message sending. Written in Python.

PyPI version

Features

  • It supports file or message of size upto about 8.85 PeB (1 PiB ~ 10^6 GiB)!.
  • Protection against transmission error using CRC32 checksum.
  • Comes with CLI (command-line argument) and Interactive mode, both!

Installation

Install it using pip

  1. $ pip3 install pearsend

Usage Examples

Command-line Mode

Help Text

  1. sumit@HAL9000:~$ pearsend -h
  2. usage: pearsend [-h] [-i] [-f FILEPATH] [--host HOST] [-p PORT]
  3. [-m MESSAGE]
  4. {send,receive}
  5. positional arguments:
  6. {send,receive} Whether to send or receive
  7. optional arguments:
  8. -h, --help show this help message and exit
  9. -i, --interactive If the program is to be run in interactive mode
  10. -f FILEPATH, --filepath FILEPATH
  11. Path of the file to be sent or to save incoming data
  12. to
  13. --host HOST Address of the source or target machine
  14. -p PORT, --port PORT Port for listening on or sending to
  15. -m MESSAGE, --message MESSAGE
  16. Message to send

Sending text message

Receiver

  1. sumit@HAL9000:~$ pearsend receive -p 5000
  2. [*] Listening for connections on: 10.194.52.135:5000
  3. [*] Connection from : 10.194.52.135:47804
  4. [*] The incoming data is >
  5. b'Hello HAL!'

Sender

  1. sumit@HAL9000:~$ pearsend send --host 10.194.52.135 -m "Hello HAL!"
  2. [*] Sent message succesfully!

Sending binary file

Receiver

  1. sumit@HAL9000:~$ pearsend receive -p 5000 -f recd.png
  2. [*] Listening for connections on: 10.194.52.135:5000
  3. [*] Connection from : 10.194.52.135:47808
  4. [*] Incoming data saved to recd.png

Sender

  1. sumit@HAL9000:~$ pearsend send --host 10.194.52.135 -f image.png
  2. [*] Sent message succesfully!

Interactive Mode

Sending text message

Receiver

  1. sumit@HAL9000:~$ pearsend receive -i
  2. [?] Port to listen on:
  3. [?] File to save the incoming data to. Leave blank to output to terminal:
  4. [*] Listening for connections on: 10.194.52.135:5000
  5. [*] Connection from : 10.194.52.135:36240
  6. [*] The incoming data is >
  7. b'Hello HAL!'

Sender

  1. sumit@HAL9000:~$ pearsend send -i
  2. [?] The address of the target machine: 10.194.52.135
  3. [?] Enter the port to connect to:
  4. [?] The file to send. Leave blank for text message:
  5. [?] Enter the message: Hello HAL!
  6. [*] Sent message succesfully!

Sending binary file

Receiver

  1. sumit@HAL9000:~$ pearsend receive -i
  2. [?] Port to listen on:
  3. [?] File to save the incoming data to. Leave blank to output to terminal: recd.jpg
  4. [*] Listening for connections on: 10.194.52.135:5000
  5. [*] Connection from : 10.194.52.135:36242
  6. [*] Incoming data saved to recd.jpg

Sender

  1. sumit@HAL9000:~$ pearsend send -i
  2. [?] The address of the target machine: 10.194.52.135
  3. [?] Enter the port to connect to:
  4. [?] The file to send. Leave blank for text message: image.jpg
  5. [*] Sent message succesfully!