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
fix(core): connect right after pairing on the local network
baiyuze32ac2748defb
diff --git a/client-core/internal/transport/lan/pairing.go b/client-core/internal/transport/lan/pairing.goindex 3dbe96b..98ff19b 100644--- a/client-core/internal/transport/lan/pairing.go+++ b/client-core/internal/transport/lan/pairing.go@@ -114,6 +114,8 @@ func (t *Transport) Pair(ctx context.Context, code string, extra []netip.AddrPor}select {case r := <-w.resp:+ // 回复带着对方的签名:它此刻就在这个地址,确认配对后的第一次连接不必再等打招呼+ t.sawPeer(r.info.GetDeviceId(), r.src, nil)return PeerInfo{ID: r.info.GetDeviceId(),Name: r.info.GetDeviceName(),@@ -232,6 +234,7 @@ func (t *Transport) handlePairRequest(ps *pb.LanPairSigned, src netip.AddrPort)t.responses[key] = cachedResponse{pkt: pkt, at: now}t.mu.Unlock()t.log.Info("局域网配对请求已接受,等待用户核对指纹", "peer", peer.Name, "src", src)+ t.sawPeer(peer.ID, src, nil)_ = t.write(src, pkt)time.AfterFunc(resendDelay, func() { _ = t.write(src, pkt) })}diff --git a/client-core/internal/transport/p2p/peer.go b/client-core/internal/transport/p2p/peer.goindex 1c5a1fc..6be4cc8 100644--- a/client-core/internal/transport/p2p/peer.go+++ b/client-core/internal/transport/p2p/peer.go@@ -286,6 +286,9 @@ func (p *Peer) Connect(ctx context.Context) error {p.armConnectTimeout()if err := p.sendSignal(ctx, offerMessage(offer, false)); err != nil {+ // offer 根本没发出去(信令无路可走),对方不可能应答:立即复位。+ // 通道一恢复上层就能重试,不必等握手超时+ p.Close()return err}// 初次握手由发起方等:应答方先公布出口地址,发起方先往那边发包