P2PFileSharing

module
v0.0.0-...-251c84f Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0

README

P2PFileSharing

File sharing in P2P manner through LAN

Warning: This application may have bugs, please use it with caution. (ps: Although there is still a gap between this application and a real p2p application. But we have at least achieved a distributed file transfer.)

image issue license last_commit

Application architecture

Peer will start a non-blocking listener service to receive requests from other nodes and pass them to the handler. It will also start a non-blocking service to listen for input from stdin and forward these commands to the handler or CLI for execution. For example, we can request the CLI to check which nodes are online, and it will retrieve the data from the cache and provide the information. Similarly, when we want to download a file, we provide the handler with the information of the file, and it will send a download request on our behalf. Additionally, the handler will be called back when it receives a request from another node. It is important to note that the cache contains runtime data, including details about the currently online nodes and files shared by other nodes.

Usage

Please check out the tutorial on my blog.

Contributing

Contributions must be available on a separately named branch based on the latest version of the main branch.

Directories

Path Synopsis
pkg
cli
p2p

Jump to

Keyboard shortcuts

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