Skip to content

Commit

Permalink
doc: add flexibility chapter
Browse files Browse the repository at this point in the history
  • Loading branch information
gnattu authored Feb 5, 2024
1 parent ffbf697 commit 5310588
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Currently, it supports Windows, macOS, and partially Linux platforms. See the [L

- Peer-to-Peer clipboard syncing: Sync clipboard contents across machines seamlessly.
- Cross-platform compatibility: Works on Windows, macOS, and partially on Linux.
- Decentralized and flexible architecture: No need for a centralized server, and works for most network topologies.
- Decentralized and [flexible architecture](#network-flexibility): No need for a centralized server, and works for most network topologies.
- Easy setup and usage: Zero config for basic usage.

## Installation
Expand Down Expand Up @@ -76,6 +76,25 @@ If not everyone in your local network is trusted by you, you can specify an extr

If you plan to use p2p-clipboard in a public network, you may want to use `-n` or `--no-mdns` to disable peer discovery with mDNS and manually specify a boot node.

## Network Flexibility

The p2p-clipboard Network is designed to be highly flexible, allowing nodes to operate in various network configurations. Unlike many other projects, it does not require all nodes to be in the same network subnet, nor does it strictly demand direct IP access to other nodes.

In the p2p-clipboard Network, when a peer receives a new message (the clipboard content) from another peer, it stores the message and forwards a copy to all other peers it is connected. This makes it possible to ensure seamless communication between nodes, even when direct IP connections are not possible.

For example, PeerB can connect to both PeerA and PeerC. However, PeerA and PeerC do not have a direct IP connection between them. In this case, PeerB will automatically act as a forwarder, ensuring that information can still be transmitted between PeerA and PeerC.

```
Peer A Peer B Peer C
+---------+ +---------+ +---------+
| | | | | |
| A |<--->| B |<--->| C |
| | | | | |
+---------+ +---------+ +---------+
```

This will be useful when some peers in your network are behind some kind of NAT, which makes other peers unable to connect to them directly. In this case, a peer behind NAT will try to establish a connection from its side to all other peers in the network. However, we may also have some other peers which are also behind NAT, making it impossible to have direct connections between them. In this case, as long as there is a forwarding path available between these two peers, they can still have the clipboard synced.

## Limitation

Currently has following limitation:
Expand Down

0 comments on commit 5310588

Please sign in to comment.