Commit Graph

13 Commits

Author SHA1 Message Date
056c027083 Update test-connect.js to use Rondevu.connect() and ICE presets
- Replace new Rondevu() + initialize() with Rondevu.connect()
- Use 'ipv4-turn' ICE server preset
- Use rondevu.addOfferIceCandidates() directly (no getAPIPublic())

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 22:21:58 +01:00
7747f59060 Fix: Use ondatachannel instead of createDataChannel for answerer
CRITICAL BUG FIX: As the answerer, we should NOT create our own data channel.
The host (offerer) creates the channel, and we receive it via ondatachannel event.

This was causing messages to be sent on a different channel than the one
the host was listening to, so no messages were being received.

Changes:
- Remove pc.createDataChannel() call
- Add pc.ondatachannel event handler
- Wrap data channel setup in setupDataChannel() function
- Called when channel is received from host
2025-12-12 21:35:34 +01:00
d7caa81042 Add data channel state monitoring and increase send delay
- Increase delay to 500ms before sending identify
- Monitor channel state before sending
- Log bufferedAmount after send
- Add onclose handler for debugging
2025-12-12 21:32:08 +01:00
ac4826e92f Add delay and more debugging to identify message sending 2025-12-12 21:28:21 +01:00
1e46cef35f Add extensive debugging to message handler 2025-12-12 21:27:24 +01:00
9e0728f74a Implement demo message protocol in test script
- Send 'identify' message on connection
- Wait for 'identify_ack' acknowledgment
- Send 'message' type with text for chat
- Keep connection open 5s to receive responses
2025-12-12 21:26:01 +01:00
778fa2e3a9 Fix: Manually serialize ICE candidates for wrtc compatibility
wrtc library doesn't have toJSON() method on RTCIceCandidate.
Manually extract candidate properties instead.
2025-12-12 21:23:40 +01:00
8bb951a91c Fix: Set up ICE handlers before setLocalDescription
- Move onicecandidate handler setup before setLocalDescription
- Directly use API for sending candidates instead of signaler
- Use signaler only for receiving remote candidates
2025-12-12 21:22:39 +01:00
833bf7e519 Fix: Use same TURN config as demo (IPv4-based)
Update test script to use 57.129.61.67 instead of turn.share.fish
to match the demo's default 'ipv4-turn' preset.
2025-12-12 21:16:35 +01:00
508f050f6e Fix: Correct wrtc import for ES modules
The wrtc package needs to access default export when using dynamic import.
2025-12-12 21:13:51 +01:00
cf13672d85 Update test script to use same API URL and service version as demo
- Use api.ronde.vu instead of rondevu.xtrdev.workers.dev
- Use chat:2.0.0 instead of chat:1.0.0 to match demo
2025-12-12 21:10:50 +01:00
758fb2d4ec Improve test script error handling for missing wrtc
Better error message when wrtc is not installed, with clear
instructions on how to install it.

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 20:42:08 +01:00
023be0ab67 Add Node.js test script for connecting to @bas
Adds test-connect.js script that:
- Connects to production Rondevu API
- Discovers chat service from @bas
- Establishes WebRTC connection using wrtc
- Sends 'hello' message via data channel

Usage: npm test

Requires:
- Node.js 19+ (or 18 with --experimental-global-webcrypto)
- wrtc package for WebRTC in Node.js

🤖 Generated with Claude Code
https://claude.com/claude-code

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-12 20:34:41 +01:00