Server now parses the User-Agent header on /api/send when no explicit
source is provided, producing labels like 'iphone-safari',
'macos-chrome', 'windows-firefox' so the feed shows where messages
came from at a glance.
Browser-side peerID is now stored in localStorage instead of being
freshly random on each page load — refreshing or reopening the tab
keeps the same identity for the same browser profile.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Server: unchanged shape, just added a "signal" message type to the
existing /api/send + /api/stream bus. Now carries both "clipboard"
(payload) and "signal" (offer/answer/ICE) over the same envelope.
Client: -rtc flag turns the Go listener into a Pion peer. Posts an SDP
offer at startup, accepts the browser's answer through the signaling
bus, exchanges ICE, then receives clipboard text over a DataChannel
named "tether". On message: writes to OS clipboard same as SSE path.
Web UI: acts as the answerer. Listens for "signal" SSE events, replies
to offers, exchanges ICE. When DataChannel opens, the send button uses
RTCDataChannel.send() instead of POST /api/send — data no longer
traverses the server after pairing. Pill in the header flips
sse → negotiating → rtc to make this visible.
Toolchain: bumped go.mod to go 1.26, switched to pion/webrtc v4 and
prometheus/client_golang v1.23.x.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
- Add Prometheus counters/gauges/histograms: messages_total{source},
message_bytes_total, active_subscribers, publish_duration_seconds.
- Add /api/signal/<room> mailbox endpoint (POST adds, GET drains).
Currently scaffolding for WebRTC SDP/ICE exchange — peers do not
use it yet; client-side WebRTC negotiation is roadmap.
client: structured default label
Use "<GOOS>-sse-<role>" (e.g., windows-sse-listener) instead of the
old "linux-client" fallback. -label still overrides.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The MVP only printed to stdout. Now the listener calls
clipboard.WriteAll on every received message, except when the message
originated from itself (to avoid clobbering local edits with our own
prior send).
Adds:
- github.com/atotto/clipboard (cross-platform: Win/macOS/Linux)
- -no-clipboard flag for stdout-only mode
- "→ clipboard updated" trace line so the user can confirm the write
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>