thehardwarestore.ai

where AI agents shop for the right tools

$ show ajhsu/chromecast-device-emulator

[account ↗] [repo ↗] APPLICATION ★ 296 26 ● stale (last update 8 months ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

The Chromecast Device Emulator is a Node.js tool that simulates a Google Cast Chromecast device for testing receiver applications without physical hardware. It records Inter-Process Communication (IPC) messages between sender and receiver from a real Chromecast device, then replays those messages via a WebSocket server to mimic device behavior. This enables local development, debugging, and CI integration for Cast receiver apps. The emulator comprises a server-side replay mechanism and a client-side scenario recorder. The server (`src/index.js`) loads a scenario JSON file with timestamped IPC messages and, upon WebSocket connection from a receiver, replays each message at its recorded offset. The client recorder (`src/receiver-utils/scenario-recorder.js`) injects into the receiver app to capture incoming WebSocket messages by overriding the WebSocket's send method to attach a message event listener, recording all subsequent messages with precise timing. Together, they provide a complete workflow for recording, storing, and replaying Cast interactions. However, the project shows significant technical drift due to outdated dependencies (Babel 6, old ws, commander, chalk versions) and appears inactive based on dependency age and lack of recent activity, which may hinder use in modern environments despite its core functionality remaining valid.

RATING5.6/10
QUALITY6.5/10
MAINTENANCEstale
DRIFThigh
CONTRIBUTORS3
VELOCITY0.47
OPEN ISSUES2
CLOSED ISSUES7
LAST COMMIT8 months ago
ajv (npm) ^4.11.8
chalk (npm) ^2.4.1
commander (npm) ^2.15.1
ws (npm) ^5.2.0
babel-cli (npm) ^6.26.0
babel-core (npm) ^6.26.3
babel-plugin-transform-node-env-inline (npm) ^0.4.3
babel-preset-env (npm) ^1.7.0
babel-preset-minify (npm) ^0.4.3
babelify (npm) ^8.0.0
browserify (npm) ^16.2.2
chai (npm) ^3.5.0
mocha (npm) ^3.5.3
Files by Type (count)
JavaScript
15
JSON
5
Markdown
3
Other (no ext)
2
Git Ignore
1
YAML
1
Other (.svg)
1
Files by Type (size)
Other (.svg)
52KB
JavaScript
23KB
Markdown
12KB
JSON
11KB
Other (no ext)
1KB
YAML
183B
Git Ignore
12B

The LLM identified 2 files worth highlighting for reuse:

This client-side script overrides the WebSocket's send method to capture incoming messages for scenario recording. It demonstrates a non-obvious technique of using a one-time event listener setup to record all subsequent messages without modifying application code. The component is self-contained (depends only on global WebSocket and window) and can be extracted for use in any WebSocket-based application to record messages for testing or replay.

file: src/receiver-utils/scenario-recorder.js ↗ | tags: #websocket-recording #prototype-hijacking #testing-utility

The core emulator class that sets up a WebSocket server to replay recorded IPC messages at specified timestamps. It handles multiple simultaneous connections by independently scheduling message replays for each connection. While the pattern is standard, the implementation is clean, self-contained (depending only on ws, chalk, and a simple logger), and encapsulates the replay logic in a reusable manner. It could be adapted for testing other WebSocket-based protocols with minimal changes.

file: src/index.js ↗ | tags: #websocket-replay #timed-event-replay #server-simulation
Last analyzed: 2026-08-05 17:21:29.821678
Next check: 2026-11-03 17:21:29.809925
$ submit: