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
import { createContext, useContext } from 'react'
import type { Session } from './api'
export interface Conn {
session: Session
device: string // 电脑的名字
name: string // 这台手机的名字
chunk: number
maxDownload: number
maxUpload: number
maxText: number
/** 第一次成功收发之后提示添加到主屏幕 */
succeeded: () => void
}
export const ConnContext = createContext<Conn | null>(null)
export function useConn(): Conn {
const c = useContext(ConnContext)
if (!c) throw new Error('ConnContext missing')
return c
}