From cf13672d8503e48add799cd0c9976cdc4ea71cf8 Mon Sep 17 00:00:00 2001 From: Bas van den Aakster Date: Fri, 12 Dec 2025 21:10:50 +0100 Subject: [PATCH] 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 --- test-connect.js | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/test-connect.js b/test-connect.js index fecdd73..10be970 100644 --- a/test-connect.js +++ b/test-connect.js @@ -2,37 +2,41 @@ /** * Test script to connect to @bas's chat service and send a "hello" message * - * Setup: - * npm install --save-optional wrtc + * IMPORTANT: This script requires the 'wrtc' package which must be installed separately. + * See TEST_README.md for detailed installation instructions. * - * Usage: - * node test-connect.js + * Quick start: + * npm install wrtc + * npm test * - * Requires: - * - Node.js 19+ or Node.js 18 with --experimental-global-webcrypto - * - wrtc package (install with: npm install wrtc) + * Requirements: + * - Node.js 19+ (or Node.js 18 with --experimental-global-webcrypto) + * - wrtc package (requires native compilation) + * - Build tools (python, make, g++) */ import { Rondevu, RondevuSignaler, NodeCryptoAdapter } from '@xtr-dev/rondevu-client' -// Try to import wrtc, provide helpful error if not found -let RTCPeerConnection +// Import wrtc +let wrtc try { - const wrtc = await import('wrtc') - RTCPeerConnection = wrtc.default.RTCPeerConnection + wrtc = await import('wrtc') } catch (error) { - console.error('❌ Error: wrtc package not found') + console.error('❌ Error: wrtc package not found or failed to load') console.error('\nThe wrtc package is required for WebRTC support in Node.js.') console.error('Install it with:') console.error('\n npm install wrtc') console.error('\nNote: wrtc requires native compilation and may take a few minutes to install.') + console.error('\nError details:', error.message) process.exit(1) } +const { RTCPeerConnection } = wrtc + // Configuration -const API_URL = 'https://rondevu.xtrdev.workers.dev' +const API_URL = 'https://api.ronde.vu' const TARGET_USER = 'bas' -const SERVICE_FQN = `chat:1.0.0@${TARGET_USER}` +const SERVICE_FQN = `chat:2.0.0@${TARGET_USER}` const MESSAGE = 'hello' // TURN server configuration