P2P-style file transfer over WSS with chunk streaming.
Project description
p2p-copy
p2p-copy is a Python library and command-line tool for transferring files and directories over a WebSocket relay server. It supports chunked streaming, optional end-to-end encryption, compression, and resume functionality, making it suitable for environments with restrictive firewalls, such as high-performance computing (HPC) systems. The tool avoids dependencies on SSH or inbound ports, relying instead on outbound connections over ports like 443.
The design prioritizes performance, low resource usage, and simplicity, with a stateless relay that forwards data without storage. For details on the protocol and internals, see Features.
Full Documentation
For detailed guides, visit the full documentation site.
Quickstart
Install via pip:
pip install p2p-copy[security]
Run Relay (one terminal)
p2p-copy run-relay-server localhost 8765 --no-tls # For development
# Or with TLS: --tls --certfile cert.pem --keyfile key.pem
Send Files (another terminal)
p2p-copy send ws://localhost:8765 mysecretcode /path/to/files_or_dirs --encrypt --compress on --resume
Receive (third terminal)
p2p-copy receive ws://localhost:8765 mysecretcode --out ./downloads --encrypt
Use the same mysecretcode for sender and receiver pairing. For full CLI details, see Usage. For production relay setup, see Relay Setup.
Key Aspects
- Pairing and Transfer: Clients connect to a relay using a shared code (hashed for security). Files are streamed in chunks with integrity checks.
- Optional Features: End-to-end encryption (AES-GCM with Argon2-derived keys), per-file compression (Zstandard), and the option to resume partial transfers.
- Use Cases: Designed for HPC workflows where traditional tools like SCP or rsync are limited by firewalls or configuration requirements.
- API Integration: Embeddable in Python scripts; see API.
For installation instructions, see Installation. For module structure, see Module Layout.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file p2p_copy-0.1.0.tar.gz.
File metadata
- Download URL: p2p_copy-0.1.0.tar.gz
- Upload date:
- Size: 48.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb512e3e1c6b39f6835ad26f8a7d3c125d6f1829555404e150d5964be398360e
|
|
| MD5 |
4f4e3586e51282485e8bdf212c95ad2b
|
|
| BLAKE2b-256 |
d1c19d9f4b08e0f71c71491f188deefa69740ae3778629a62c6c990827554efc
|
File details
Details for the file p2p_copy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: p2p_copy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 19.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-httpx/0.28.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0c95e4a43c94df59624c17e94429f47ca1de484db77b29874f5db56f3677bc9
|
|
| MD5 |
4a445667654de93530026c2c4b4d5aed
|
|
| BLAKE2b-256 |
1a9b65ad5faa3a43f7f8dd1b7e3cfc51b7827da8d116681cb1f6fbef5bd1e03b
|