How hungdo2006/crocstream works
CrocStream is a Windows desktop app for authenticated, encrypted 1-to-1 screen sharing, with local preview and live performance metrics. The main flow is share/watch UI → session lifecycle and desktop API → capture and frame processing → session protocol and relay transport → remote frame display. The graph also includes the documented Tile-Delta recovery and metrics branches, plus the standalone demo relay. Relationship evidence is limited to the README and the excerpts and SOURCE INDEX entries shown; unsampled details are omitted.
Main entry points: stream.tsx Share and watch UI · session/controller.go Session controller · service_windows.go Desktop service · preview/controller.go Preview controller
Components 24
Desktop interface
- Share and watch UI
app/frontend/src/stream.tsx - Local preview UI
app/frontend/src/local-preview.tsx - App navigation
app/frontend/src/main.tsx - Session hooks
app/frontend/src/hooks/useSession.ts - Session lifecycle
app/frontend/src/session-lifecycle.ts - Capture settings
app/frontend/src/capture-settings.tsx - Frame stream hook
app/frontend/src/hooks/useFrameStream.ts - Metrics dashboard
app/frontend/src/stream-metrics.tsx
Session backend
- Desktop API
app/frontend/src/api.ts - Desktop service
app/internal/desktop/service_windows.go - Session controller
app/internal/session/controller.go - Preview controller
app/internal/preview/controller.go
Media processing
- Screen capture
app/internal/capture/capture_windows.go - Tile-Delta codec
app/internal/delta/codec.go - Frame protocol
app/internal/protocol/stream.go - Latest-frame queue
app/internal/latest/queue.go - Stream telemetry
app/internal/telemetry/meter.go
Connectivity
- Preview image bridge
app/internal/bridge/bridge.go - Relay transport
app/internal/transport/factory.go - Peer session
app/internal/session/peer.go - Demo relay launcher
app/cmd/demo-relay/main.go
Other components
- Sharer
- Viewer
- TCP relay
Connections 31
- Sharer → Share and watch UI: starts sharing
README.md - Viewer → Share and watch UI: joins by code
README.md - App navigation → Share and watch UI: opens
app/frontend/src/main.tsx - App navigation → Local preview UI: opens preview
app/frontend/src/main.tsx - Share and watch UI → Session hooks: uses
app/frontend/src/stream.tsx - Share and watch UI → Capture settings: configures
app/frontend/src/stream.tsx - Share and watch UI → Frame stream hook: uses
app/frontend/src/stream.tsx - Share and watch UI → Session lifecycle: manages
app/frontend/src/stream.tsx - Share and watch UI → Metrics dashboard: renders
app/frontend/src/stream.tsx - Local preview UI → Frame stream hook: uses
app/frontend/src/local-preview.tsx - Local preview UI → Capture settings: configures
app/frontend/src/local-preview.tsx - Session hooks → Session lifecycle: delegates
app/frontend/src/hooks/useSession.ts - Session hooks → Desktop API: calls
app/frontend/src/hooks/useSession.ts - Desktop API → Desktop service: invokes
README.md - Desktop service → Session controller: creates
app/internal/desktop/service_windows.go - Desktop service → Preview controller: creates
app/internal/desktop/service_windows.go - Desktop service → Relay transport: configures
app/internal/desktop/service_windows.go - Session controller → Screen capture: captures
app/internal/session/controller.go - Session controller → Latest-frame queue: publishes frames
app/internal/session/controller.go - Session controller → Frame protocol: runs peer
app/internal/session/controller.go - Session controller → Relay transport: opens connection
app/internal/session/controller.go - Session controller → Preview image bridge: uses
app/internal/session/controller.go - Session controller → Stream telemetry: measures
app/internal/session/controller.go - Preview controller → Screen capture: captures
app/internal/preview/controller.go - Preview controller → Preview image bridge: publishes images
app/internal/preview/controller.go - Preview controller → Stream telemetry: measures
app/internal/preview/controller.go - Screen capture → Tile-Delta codec: encodes changes
- Tile-Delta codec → Frame protocol: frames
- Frame protocol → Viewer: delivers encrypted frames
README.md - Relay transport → TCP relay: connects
README.md - Demo relay launcher → TCP relay: runs local relay
README.md