FastCopy
A multi-threaded file transfer tool over SSH protocol.
Aims to replace scp and rsync.
Features
- File chunking with parallel transfers for faster speeds
- Supports filename wildcards and regular expressions for file matching
- Automatically skips files with identical content on local and remote
- rsync-style delta sync: only transfers the differences of modified files
- Reliable transfer: per-chunk ACK + retransmission, idle-connection timeout with automatic failover
- Automatically preserves file permissions between sender and receiver
- Supports SSH Config
- Supports SSH Agent
TODO
- Resume interrupted transfers
- Improve configuration management
- Confirm session parameters during handshake, remove global variables
- Version forward/backward compatibility
- Preserve symbolic links
- Replace sum-of-bytes weak checksum with Adler-32 rolling checksum in delta sync
- Stream delta sync for files larger than
DELTA_MAX_SIZE(currently falls back to full transfer)
Installation
The program must be installed on both the server and the local machine before use.
pip install fastcopy
Usage
-
Server
Ensure port 7523 is not occupied on the server before running
fcpd -d -
Local
Packet Design
All packets use big-endian byte order.
1. Unified Packet Format
| flag | chksum | length | payload |
|---|---|---|---|
| 1 Bytes | 4 Bytes | 4 Bytes | ... |
2. Packet Types
- Push request:
0x1 - Pull request:
0x2 - Establish session:
0x3 - Subsequent connection:
0x4 - Transfer mode:
0x5 - Directory info:
0x6 - File info:
0x7 - File count:
0x8 - File ready:
0x9 - Data transfer:
0xa - Transfer complete:
0xb - Abnormal exit:
0xc - Chunk acknowledgment:
0xd - File done acknowledgment:
0xe - Block signature (delta sync):
0xf - Delta literal:
0x10 - Delta block copy:
0x11 - Delta done:
0x12
3. Packet Details
-
Data Request
After the connection is established, the client must first request a pull or push from the server and pass the destination path to the server.
-
The direction (pull/push) is determined by the
flagfield -
Direction: Client -> Server
-
Payload format:
connection info json string
-
-
Establish Session
Upon receiving the request in step 1, the server generates a SessionID and sends it back to the client. The client saves it locally.
-
Direction: Server -> Client
-
Payload format:
session_id 16 Bytes
-
-
Subsequent Connections
Concurrent connections established by the client after the initial handshake must send the SessionID as the first packet.
-
Direction: Client -> Server
-
Payload format:
session_id 16 Bytes
-
-
File Count
Once the connection is ready, the sender must inform the receiver of the total number of files.
-
Payload length is 4 bytes, so the maximum number of files is 4,294,967,296
-
Direction: Sender -> Receiver
-
Payload format:
n_files 4 Bytes
-
-
File Info
The sender must communicate the information of each file to the receiver. This includes file ID, permissions, size, creation time, modification time, access time, checksum, and path. The path is relative.
-
Direction: Sender -> Receiver
-
Payload format:
file_id perm size mtime chksum path 4 Bytes 2 Bytes 8 Bytes 8 Bytes 16 Bytes ...
-
-
Receiver File Ready
After receiving the file info, the receiver records the information and creates an empty file of the same size locally.
-
Direction: Receiver -> Sender
-
Payload format:
file_id 4 Bytes
-
-
File Data Chunk Packet
The chunk sequence field occupies 4 bytes, so the maximum supported file size is: 4 GB * ChunkSize
-
Direction: Sender -> Receiver
-
Payload format:
file_id seq data 4 Bytes 4 Bytes ...
-
4. Handshake Process
| Step | Client | Server |
|---|---|---|
| 1 | Client starts | Server starts |
| 2 | Waiting for client | |
| 3 | Initiate connection | |
| 4 | Accept connection | |
| 5 | Wait for request (timeout disconnects) | |
| 6 | Send PUSH or PULL request |
|
| 7 | Generate SessionID | |
| 8 | Send SessionID to client | |
| 9 | Receive and save SessionID | |
| 10 | Create multiple parallel connections | |
| 11 | Each new connection sends ATTACH with SessionID |
|
| 12 | Verify SessionID is valid | |
| 13 | Add connection to session pool |
Metadata
Release files for fastcopy 0.1.9
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fastcopy-0.1.9.tar.gz | 32.0 kB | Without provenance | Details for fastcopy-0.1.9.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fastcopy-0.1.9-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details for fastcopy-0.1.9-py2.py3-none-any.whl |
Total release size: 59.0 kB
Release files / fastcopy-0.1.9.tar.gz
| Download URL | fastcopy-0.1.9.tar.gz |
|---|---|
| Size | 32.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b36b0ace96df16b563892cc09acebc258ef22b386860d9fbb9b32c452020ff85
|
|
BLAKE2b-256 checksum How to use checksums |
d212c3314ecc8c42c813373f87a7b46dcda12ab02a34de7aaf9cbda2a9970086
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / fastcopy-0.1.9-py2.py3-none-any.whl
| Download URL | fastcopy-0.1.9-py2.py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
30d4a4573f32b18896f29d2e10a5655c2c09b57003c87ac9f8c3fba3d6eb84cc
|
|
BLAKE2b-256 checksum How to use checksums |
887fc10b01416d63ab8b20fa9d4a6b8464c0bd667de2cfd367129c1f0a4caae2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for fastcopy 0.1.9
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.