PasteFerry (隔空贴): clipboard and file sync across macOS, Windows and Linux. Direct-first, end-to-end encrypted. Optional official access: no server to host. Independent self-hosting remains available.
Dart airdrop-alternativeclipboardclipboard-sharingclipboard-synccopy-pastecross-platformend-to-end-encryptionfile-syncfile-transferfluttergolanglinuxmacosnat-traversalp2pself-hostedtailscaleuniversal-clipboardwebrtcwindows
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<script>
(function () {
if (location.hostname !== "baiyuze.github.io") return;
var prefix = /^\/(?:pasteferry|copysync)(?=\/|$)/.exec(location.pathname);
if (!prefix) return;
var path = location.pathname.slice(prefix[0].length) || "/";
location.replace("https://pasteferry.cc" + path + location.search + location.hash);
})();
</script>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>How PasteFerry works: direct connections, multi-uplink probing and failure handling</title>
<meta name="description" content="What happens when you copy, how computers connect, and what happens when they can’t.">
<link rel="canonical" href="https://pasteferry.cc/en/how/">
<link rel="alternate" hreflang="zh-CN" href="https://pasteferry.cc/how/">
<link rel="alternate" hreflang="zh-TW" href="https://pasteferry.cc/zh-tw/how/">
<link rel="alternate" hreflang="zh-HK" href="https://pasteferry.cc/zh-hk/how/">
<link rel="alternate" hreflang="en" href="https://pasteferry.cc/en/how/">
<link rel="alternate" hreflang="ja" href="https://pasteferry.cc/ja/how/">
<meta name="theme-color" content="#141416">
<meta property="og:type" content="article">
<meta property="og:site_name" content="PasteFerry">
<meta property="og:title" content="How PasteFerry works: direct connections, multi-uplink probing and failure handling">
<meta property="og:description" content="What happens when you copy, how computers connect, and what happens when they can’t.">
<meta property="og:url" content="https://pasteferry.cc/en/how/">
<meta property="og:image" content="https://pasteferry.cc/assets/og-en.png">
<meta property="og:locale" content="en_US">
<meta name="twitter:card" content="summary_large_image">
<link rel="icon" href="../../assets/favicon.svg?v=df696024d8" type="image/svg+xml">
<link rel="icon" href="../../assets/favicon-32.png?v=8e9afa506d" sizes="32x32" type="image/png">
<link rel="apple-touch-icon" href="../../assets/apple-touch-icon.png?v=bcbf406cb8">
<link rel="stylesheet" href="../../assets/site.css?v=dbae55d27c">
<script>document.documentElement.classList.add("js");if (!/Mac|iPhone|iPad/.test(navigator.platform || navigator.userAgent)) document.documentElement.classList.add("pc");</script>
</head>
<body>
<a class="skip" href="#main">Skip to content</a>
<header class="bar">
<div class="wrap">
<a class="brand" href="../../en/" aria-label="PasteFerry home"><img src="../../assets/icon.svg?v=65a69999e0" alt="" width="26" height="26">PasteFerry</a>
<nav aria-label="Page">
<a href="../../en/features/">Features</a>
<a class="mid" href="../../en/start/">Quick start</a>
<a class="wide" href="../../en/start/#server">Ways to connect</a>
<a href="../../en/download/">Download</a>
<details class="menu">
<summary aria-label="More pages" class="current"><span>More</span><svg class="chev" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 4.5 3 3 3-3"/></svg></summary>
<ul>
<li class="narrow"><a href="../../en/start/">Quick start</a></li>
<li class="narrow"><a href="../../en/start/#server">Ways to connect</a></li>
<li><a href="../../en/themes/">Themes guide</a></li>
<li><a href="./" aria-current="page">How it works</a></li>
<li><a href="../../en/security/">Security</a></li>
<li><a href="../../en/faq/">FAQ</a></li>
<li><a href="../../en/feedback/">Discussion & feedback</a></li>
<li class="sep" role="separator"></li>
<li><a href="https://github.com/baiyuze/pasteferry/blob/main/CHANGELOG.md">Changelog</a></li>
<li class="narrow-gh"><a href="https://github.com/baiyuze/pasteferry">GitHub</a></li>
</ul>
</details>
<a class="gh" href="https://github.com/baiyuze/pasteferry" data-gh-stars aria-label="Star PasteFerry on GitHub"><svg class="gh-mark" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59.4.07.55-.17.55-.38 0-.19-.01-.82-.01-1.49-2.01.37-2.53-.49-2.69-.94-.09-.23-.48-.94-.82-1.13-.28-.15-.68-.52-.01-.53.63-.01 1.08.58 1.23.82.72 1.21 1.87.87 2.33.66.07-.52.28-.87.51-1.07-1.78-.2-3.64-.89-3.64-3.95 0-.87.31-1.59.82-2.15-.08-.2-.36-1.02.08-2.12 0 0 .67-.21 2.2.82.64-.18 1.32-.27 2-.27.68 0 1.36.09 2 .27 1.53-1.04 2.2-.82 2.2-.82.44 1.1.16 1.92.08 2.12.51.56.82 1.27.82 2.15 0 3.07-1.87 3.75-3.65 3.95.29.25.54.73.54 1.48 0 1.07-.01 1.93-.01 2.2 0 .21.15.46.55.38A8.013 8.013 0 0016 8c0-4.42-3.58-8-8-8z"/></svg><span class="gh-label">Star</span><span class="gh-count" hidden><svg class="gh-star" viewBox="0 0 16 16" aria-hidden="true"><path fill="currentColor" d="M8 .25a.75.75 0 01.673.418l1.882 3.815 4.21.612a.75.75 0 01.416 1.279l-3.046 2.97.719 4.192a.751.751 0 01-1.088.791L8 12.347l-3.766 1.98a.75.75 0 01-1.088-.79l.72-4.194L.818 6.374a.75.75 0 01.416-1.28l4.21-.611L7.327.668A.75.75 0 018 .25z"/></svg><b></b></span></a>
<details class="lang">
<summary aria-label="Language:English"><svg viewBox="0 0 20 20" fill="none" stroke="currentColor" stroke-width="1.4" aria-hidden="true"><circle cx="10" cy="10" r="7.25"/><path d="M2.75 10h14.5M10 2.75c-2.1 2-3.1 4.4-3.1 7.25s1 5.25 3.1 7.25M10 2.75c2.1 2 3.1 4.4 3.1 7.25s-1 5.25-3.1 7.25"/></svg><span>English</span><svg class="chev" viewBox="0 0 12 12" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="m3 4.5 3 3 3-3"/></svg></summary>
<ul>
<li><a href="../../how/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a></li>
<li><a href="../../zh-tw/how/" hreflang="zh-TW" lang="zh-TW" data-lang="zh-tw">繁體中文(台灣)</a></li>
<li><a href="../../zh-hk/how/" hreflang="zh-HK" lang="zh-HK" data-lang="zh-hk">繁體中文(香港)</a></li>
<li><a href="../../en/how/" hreflang="en" lang="en" data-lang="en" aria-current="page">English</a></li>
<li><a href="../../ja/how/" hreflang="ja" lang="ja" data-lang="ja">日本語</a></li>
</ul>
</details>
</nav>
</div>
</header>
<main id="main">
<section class="hero guide-hero">
<div class="wrap">
<p class="crumb"><a href="../../en/">PasteFerry</a></p>
<h1 class="display">How it works</h1>
<p class="lede">What happens when you copy, how computers connect, and what happens when they can’t.</p>
</div>
</section>
<section class="section" aria-labelledby="flow-title">
<div class="wrap">
<h2 id="flow-title">What happens when you copy</h2>
<p class="intro">Text, images and files all take the same path.</p>
<ol class="flow">
<li><h3>Notice</h3><p>The background service sees that the clipboard changed.</p></li>
<li><h3>Send</h3><p>Text and files up to 50 MB go over right away. Larger ones are sent as a record first.</p></li>
<li><h3>Paste</h3><p>The other computer saves it locally and puts it on the clipboard. You paste a real file.</p></li>
</ol>
</div>
</section>
<section class="section" id="diagram" aria-labelledby="how-title">
<div class="wrap">
<h2 id="how-title">How PasteFerry connects</h2>
<p class="intro">On the same network, the computers find each other directly. On different networks, a server introduces them so they can try to connect directly, and relays only if that fails. Content is always encrypted.</p>
<figure class="diagram">
<svg viewBox="0 0 960 400" role="img" aria-labelledby="diagram-title diagram-desc">
<title id="diagram-title">How PasteFerry connects</title>
<desc id="diagram-desc">Computer A and computer B connect directly over WebRTC. Both connect to the server for signaling. If the direct connection fails, data is relayed through the server's TURN service.</desc>
<rect class="d-box" x="360" y="24" width="240" height="96" rx="14"/>
<text class="d-title" x="480" y="64" text-anchor="middle">Signaling and relay service</text>
<text class="d-sub" x="480" y="92" text-anchor="middle">Signaling, STUN, TURN relay</text>
<path class="d-sig" d="M140 210V58H360"/>
<path class="d-sig" d="M820 210V58H600"/>
<path class="d-relay" d="M196 210V100H360"/>
<path class="d-relay" d="M764 210V100H600"/>
<text class="d-note" x="210" y="50">Signaling: connection details</text>
<text class="d-note" x="210" y="128">Relay: only if direct fails</text>
<rect class="d-box" x="40" y="210" width="240" height="120" rx="14"/>
<text class="d-title" x="160" y="262" text-anchor="middle">Mac</text>
<text class="d-sub" x="160" y="290" text-anchor="middle">You copy here</text>
<rect class="d-box" x="680" y="210" width="240" height="120" rx="14"/>
<text class="d-title" x="800" y="262" text-anchor="middle">Mac, Windows or Linux</text>
<text class="d-sub" x="800" y="290" text-anchor="middle">You paste here</text>
<path class="d-direct" d="M280 270H680"/>
<text class="d-label" x="480" y="256" text-anchor="middle">Direct WebRTC, DTLS encrypted</text>
<text class="d-note" x="480" y="298" text-anchor="middle">Data moves only between your computers</text>
<g class="d-legend" transform="translate(40 372)">
<path class="d-direct" d="M0 0H28"/><text x="38" y="5">Data (direct)</text>
<path class="d-relay" d="M210 0H238"/><text x="248" y="5">Data (relay, fallback)</text>
<path class="d-sig" d="M470 0H498"/><text x="508" y="5">Signaling</text>
</g>
</svg>
<ul class="points diagram-text">
<li><strong>Direct WebRTC, DTLS encrypted</strong> Data moves only between your computers</li>
<li><strong>Signaling and relay service</strong> Signaling, STUN, TURN relay</li>
<li>Relay: only if direct fails</li>
</ul>
</figure>
</div>
</section>
<section class="section" id="multi-uplink" aria-labelledby="multi-title">
<div class="wrap">
<h2 id="multi-title">Direct on office networks too</h2>
<p class="intro">Office networks with several uplinks used to go through the relay. PasteFerry finds every uplink and lets the other side try each one.</p>
<div class="cols">
<div>
<h3>What it does</h3>
<ul class="points">
<li><strong>One shared port.</strong> All connections use the same UDP port.</li>
<li><strong>Every uplink probed.</strong> It asks seven servers at once and gets one address per uplink.</li>
<li><strong>All of them sent to the other side.</strong> The other computer tries each one until one gets through.</li>
<li><strong>Retry direct while idle.</strong> The relay keeps things working, and it switches to direct when idle.</li>
</ul>
</div>
<div>
<h3>Tested on real network setups</h3>
<p class="small">Every commit is tested automatically on simulated networks.</p>
<div class="table-scroll">
<table>
<thead><tr><th scope="col">Scenario</th><th scope="col">Result</th></tr></thead>
<tbody>
<tr><td>Single uplink ↔ home router</td><td>Direct</td></tr>
<tr><td>Two uplinks, previous version (control)</td><td>Relay</td></tr>
<tr><td>Four uplinks ↔ home router</td><td>Direct</td></tr>
<tr><td>Two uplinks ↔ two uplinks</td><td>Direct</td></tr>
<tr><td>Two uplinks ↔ NAT that randomizes ports</td><td>Relay</td></tr>
<tr><td>Blocked at first, network recovers later</td><td>Relay, then direct</td></tr>
<tr><td>No server, same subnet</td><td>Direct</td></tr>
<tr><td>No server, subnets isolated from each other</td><td>No connection</td></tr>
</tbody>
</table>
</div>
<p class="small">Measured: a Mac on a 4-uplink office network and one at home relayed at 0.6 MB/s before. Now they connect directly.</p>
<p class="small">Details are in the <a href="../../design/nat-traversal.html">design document</a> (in Chinese).</p>
</div>
</div>
</div>
</section>
<section class="section" id="fallbacks" aria-labelledby="fallback-title">
<div class="wrap">
<h2 id="fallback-title">When things go wrong</h2>
<p class="intro">The common cases are handled.</p>
<dl class="fallbacks">
<div><dt>Can't find the other computer on the network</dt><dd>Enter its address when pairing; it's remembered afterwards.</dd></div>
<div><dt>No direct connection</dt><dd>Data is relayed through the server, still encrypted.</dd></div>
<div><dt>The other computer sleeps or drops off</dt><dd>It reconnects on its own when it's back.</dd></div>
<div><dt>Disconnected while sending files</dt><dd>The transfer resumes where it stopped.</dd></div>
<div><dt>A file name Windows doesn't allow</dt><dd>Bad characters become full-width ones, so the name still reads the same.</dd></div>
<div><dt>Copying a password</dt><dd>On Windows, anything copied from a password manager is skipped.</dd></div>
</dl>
</div>
</section>
<section class="section" id="specs" aria-labelledby="specs-title">
<div class="wrap">
<h2 id="specs-title">Specifications</h2>
<div class="table-scroll">
<table class="specs">
<tbody>
<tr><th scope="row">Version</th><td>2.10.1, released <time datetime="2026-11-07">November 7, 2026</time></td></tr>
<tr><th scope="row">Mac app</th><td>macOS 13 Ventura or later; separate downloads for Apple silicon and Intel, about 25 MB each, no Rosetta; a universal version for both is about 47 MB</td></tr>
<tr><th scope="row">Windows app</th><td>Windows 10 and Windows 11, x64; installs per user, no administrator rights; about 23 MB download</td></tr>
<tr><th scope="row">Linux app</th><td>x64 and ARM64; .deb (Debian, Ubuntu and similar) or tar.gz (other distributions), about 22 MB; needs an X11 desktop, or a Wayland desktop with XWayland (GNOME, KDE and others include it by default); GTK 3</td></tr>
<tr><th scope="row">Server</th><td>Not needed with Service or on the same network. To run your own: Linux x86_64/ARM64, macOS, or Windows 10/11 x64.</td></tr>
<tr><th scope="row">Languages</th><td>English, Simplified Chinese, Traditional Chinese (Taiwan and Hong Kong) and Japanese; follows the system by default, switchable in Settings</td></tr>
<tr><th scope="row">Content</th><td>Plain text, rich text, images and screenshots, files, folders; each type can be turned off</td></tr>
<tr><th scope="row">Transport</th><td>WebRTC data channels, direct first with TURN relay fallback; on the same network, mDNS discovery and connection details over UDP 8788; every uplink probed on multi-uplink networks; files streamed as tar + zstd</td></tr>
<tr><th scope="row">Encryption and identity</th><td>End-to-end DTLS; Ed25519 device keys; every signaling message signed</td></tr>
<tr><th scope="row">Pairing</th><td>6-character code valid for 5 minutes, using an alphabet without look-alikes such as 0/O and 1/I; fingerprints checked by you</td></tr>
<tr><th scope="row">Auto-sync limit</th><td>50 MB by default, adjustable from 1 MB to 1 GB</td></tr>
<tr><th scope="row">Send Files</th><td>To one device, any size, files or whole folders; on the local network over an encrypted TCP link (both sides need 2.5.1), falling back to WebRTC when that's unavailable; WebRTC over the internet and relay; resumes after a disconnect; SHA-256 per file. Measured Mac to Linux VM, 1 GB: 144.3 MB/s; actual speed depends on the network and disks.</td></tr>
<tr><th scope="row">Contacts</th><td>7-character contact code starting with F, exchanged over the local network or Service, with an optional safety code check; contacts can only send each other files and images, with a note of up to 200 characters, and each batch must be accepted; contacts never see your clipboard, history or devices; received files lose the executable bit and are quarantined on a Mac; both sides need 2.6 or later</td></tr>
<tr><th scope="row">History</th><td>3 days by default, adjustable from 1 hour to 30 days; expired items removed automatically</td></tr>
<tr><th scope="row">Measured speed</th><td>A 20 MB file transfers in about 330 ms over a direct LAN connection, checksums matching</td></tr>
<tr><th scope="row">Built with</th><td>Go for the background service and server (pure Go calling Win32 on Windows and speaking the X11 protocol on Linux), Flutter for the app (one codebase for all three systems), Protocol Buffers for messages</td></tr>
<tr><th scope="row">License</th><td><a href="https://github.com/baiyuze/pasteferry/blob/main/LICENSING.md">GNU AGPL-3.0</a></td></tr>
</tbody>
</table>
</div>
</div>
</section>
</main>
<footer class="footer">
<div class="wrap">
<p>PasteFerry is open source under the GNU AGPL-3.0.</p>
<nav aria-label="Footer">
<a href="https://github.com/baiyuze/pasteferry/releases">All releases</a>
<a href="https://github.com/baiyuze/pasteferry/blob/main/CHANGELOG.md">Changelog</a>
<a href="https://pasteferry.cc/design/nat-traversal.html">Design notes (Chinese)</a>
<a href="https://github.com/baiyuze/pasteferry/blob/main/LICENSING.md">License</a>
<a href="https://github.com/baiyuze/pasteferry/issues">Report an issue</a>
<a href="../../en/privacy/">Privacy</a>
<a href="../../en/feedback/">Discussion & feedback</a>
</nav>
<nav aria-label="Language">
<a href="../../how/" hreflang="zh-CN" lang="zh-CN" data-lang="zh">简体中文</a>
<a href="../../zh-tw/how/" hreflang="zh-TW" lang="zh-TW" data-lang="zh-tw">繁體中文(台灣)</a>
<a href="../../zh-hk/how/" hreflang="zh-HK" lang="zh-HK" data-lang="zh-hk">繁體中文(香港)</a>
<a href="../../en/how/" hreflang="en" lang="en" data-lang="en" aria-current="page">English</a>
<a href="../../ja/how/" hreflang="ja" lang="ja" data-lang="ja">日本語</a>
</nav>
</div>
</footer>
<script src="../../assets/site.js?v=fb60f6e5ce" defer></script>
<script src="/assets/analytics.js?v=e2777f714d" defer></script>
<script type="module" src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "7ee226baf4a949a397c4bfd69a9e7461"}'></script>
</body>
</html>