17 Commits

Author SHA1 Message Date
6a24514e7b Fix signature validation issues in demo
- Add comprehensive logging for init and publish flows
- Verify username is claimed before publishing service
- Detect keypair mismatches and provide clear error messages
- Handle authentication errors more gracefully
- Auto-claim username if not claimed during publish
- Improved user guidance for common errors
2025-12-09 22:54:31 +01:00
46f0eb2e7a Restore full-featured chat UI with contact management, multiple chats, and RTC presets
- Restored contact management (add/remove friends)
- Restored multiple concurrent chat support
- Restored RTC configuration presets (ipv4-turn, hostname-turns, google-stun, relay-only, custom)
- Restored settings modal
- Restored dark theme styling
- Restored online status indicators
- Adapted all features to work with new unified Rondevu API
- Manual RTCPeerConnection management instead of ServiceHost/ServiceClient
- Manual offer pooling (10 concurrent connections)
- Manual ICE candidate polling
2025-12-09 22:49:11 +01:00
9e26ed3b66 Update to use local client package for development
- Install client from local path instead of npm registry
- Workaround for npm registry propagation delay

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 22:40:41 +01:00
7835ebd35d v2.1.0: Rewrite to use simplified Rondevu API
- Complete rewrite to use low-level Rondevu API directly
- Removed ServiceHost/ServiceClient abstractions
- Manual RTCPeerConnection and data channel setup
- Custom polling for answers and ICE candidates
- Updated to use new Rondevu class instead of RondevuService
- Direct signaling method calls instead of getAPI()
- Reduced from 926 lines to 542 lines (42% reduction)
- Demonstrates complete WebRTC flow with clear offerer/answerer roles

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-09 22:23:04 +01:00
5f223356ba feat: improve login persistence with server verification
- Properly await isUsernameClaimed() check during initialization
- Verify saved username is still valid on the server
- Show 'Welcome back' toast when restoring session
- Handle expired usernames gracefully
2025-12-08 21:39:58 +01:00
ab55a96fac fix: add missing ServiceHost and ServiceClient imports
- Import ServiceHost and ServiceClient from @xtr-dev/rondevu-client
- Fixes ReferenceError when starting hosting
2025-12-08 21:37:03 +01:00
158e001055 chore: update rondevu-client to v0.12.0 2025-12-07 22:23:13 +01:00
9967e8d762 Refactor demo to use new ServiceHost and ServiceClient API
- Update to @xtr-dev/rondevu-client v0.10.1
- Replace Rondevu class with RondevuService, ServiceHost, ServiceClient
- Simplify demo implementation (removed complex features)
- Use new event-driven API for connections
- Support custom RTC configuration
- Backup old implementation as App-old.jsx

Breaking changes from v1 API:
- RondevuService for username claiming
- ServiceHost for hosting services with offer pool
- ServiceClient for connecting with auto-reconnection

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 19:46:07 +01:00
8c3f21f262 Update @xtr-dev/rondevu-client to v0.10.0
- ServiceHost: Manages offer pool for hosting services
- ServiceClient: Connects to hosted services with auto-reconnection
- RondevuService: High-level API for username claiming and service publishing

Note: Demo code still uses old Rondevu API and needs refactoring

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 19:39:54 +01:00
c511b15fbf Update to rondevu-client v0.9.2 with ICE collection fix
Updated to @xtr-dev/rondevu-client@0.9.2 which fixes critical timing
issue where ICE candidates were generated before handlers were attached.

Now includes detailed logging for service pool ICE candidate generation
with candidate types (host/srflx/relay) for debugging TURN issues.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 11:33:42 +01:00
71454e31d1 Add WebRTC configuration settings UI
Added a settings modal with dropdown to select from preset RTC
configurations or provide custom JSON config:

- IPv4 TURN (Recommended): Uses explicit IPv4 addresses to avoid
  DNS resolution issues and address type mismatches
- Hostname TURNS (TLS): Uses secure TURNS on port 5349 with hostname
- Google STUN Only: Minimal config for testing direct connections
- Force TURN Relay: Testing mode that forces relay usage
- Custom Configuration: Users can paste their own RTCConfiguration JSON

Settings are persisted in localStorage and applied to all new
connections and service exposures.

This allows users to test different configurations without rebuilding
and helps diagnose connection issues.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 11:26:44 +01:00
b2a17ce42b Update to rondevu-client v0.9.1 with ICE logging
Updated to @xtr-dev/rondevu-client@0.9.1 which includes detailed
ICE candidate exchange logging for debugging connection issues.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-07 11:15:07 +01:00
3a42f74371 Add TURNS (secure) endpoints for upgraded TURN server
Updated ICE configuration to use TURNS (TLS/DTLS) on port 5349
as the preferred relay method, with plain TURN on port 3478 as
fallback. WebRTC will try secure endpoints first for better
security and reliability.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-06 15:58:15 +01:00
2cbd46b27a Fix datachannel name to match service pool
Changed channel name from 'chat' to 'rondevu-service' to match the
channel name created by the service pool. This fixes the connection
failure where the offerer's channel and answerer's channel had
different names and couldn't connect.

The service pool creates a channel named 'rondevu-service', so clients
must use the same name to receive that channel.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-06 13:59:30 +01:00
b3dde85cd2 Force TURN relay mode to bypass NAT hairpinning
Added iceTransportPolicy: 'relay' to RTC_CONFIG to force TURN relay usage.
This bypasses NAT hairpinning issues when testing on the same network
(e.g., two browser tabs on the same machine).

This setting ensures maximum compatibility and reliability for WebRTC
connections by always using the TURN relay instead of attempting direct
or STUN-based connections.

Note: Should be commented out in production to allow direct connections
when possible for better performance.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-06 13:49:52 +01:00
66dc35c1a7 Remove rondevu-client from dependencies (using npm link)
The demo now uses npm link to use the local client development version
instead of the published package from npm registry.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-06 13:30:06 +01:00
74bf2757ff feat: v0.9.0 - durable WebRTC connections with automatic reconnection
- Replace low-level APIs with high-level durable connections
- Add automatic reconnection with exponential backoff
- Add message queuing during disconnections
- Add TTL auto-refresh for services
- Add comprehensive TypeScript types
- Update README and create MIGRATION.md guide

BREAKING CHANGES:
- Removed: client.services.*, client.discovery.*, client.createPeer()
- Added: client.exposeService(), client.connect(), client.connectByUuid()
- Handler signature changed from (channel, peer, connectionId?) to (channel, connectionId)
- Channels now use .on('message') instead of .onmessage
- Services must call service.start() to begin accepting connections
2025-12-06 12:58:30 +01:00
5 changed files with 2084 additions and 250 deletions

View File

@@ -6,12 +6,37 @@
When configuring TURN servers:
-**DO** include the port number in TURN URLs: `turn:server.com:3478`
-**DO** use TURNS (secure) on port 5349 when available: `turns:server.com:5349`
-**DO** include TURN fallback on port 3478: `turn:server.com:3478`
-**DO** include the port number in TURN URLs (even if default)
-**DO** test TURN connectivity before deploying: `turnutils_uclient -u user -w pass server.com 3478 -y`
-**DO** provide both TCP and UDP transports for maximum compatibility
-**DON'T** omit the port number (even if it's the default 3478)
-**DON'T** omit the port number
-**DON'T** assume TURN works without testing
**Current Configuration:**
```javascript
const RTC_CONFIG = {
iceServers: [
{ urls: ["stun:stun.share.fish:3478"] },
{
urls: [
// TURNS (secure) - TLS/DTLS on port 5349 (preferred)
"turns:turn.share.fish:5349?transport=tcp",
"turns:turn.share.fish:5349?transport=udp",
// TURN (fallback) - plain on port 3478
"turn:turn.share.fish:3478?transport=tcp",
"turn:turn.share.fish:3478?transport=udp",
],
username: "webrtcuser",
credential: "supersecretpassword"
}
]
};
```
WebRTC will try TURNS (secure) endpoints first, falling back to plain TURN if needed.
### ICE Configuration
**Force Relay Mode for Testing:**

41
package-lock.json generated
View File

@@ -8,7 +8,7 @@
"name": "rondevu-demo",
"version": "2.0.0",
"dependencies": {
"@xtr-dev/rondevu-client": "^0.8.3",
"@xtr-dev/rondevu-client": "file:../client",
"@zxing/library": "^0.21.3",
"qrcode": "^1.5.4",
"react": "^18.2.0",
@@ -22,6 +22,27 @@
"vite": "^5.4.11"
}
},
"../client": {
"name": "@xtr-dev/rondevu-client",
"version": "0.13.0",
"license": "MIT",
"dependencies": {
"@noble/ed25519": "^3.0.0"
},
"devDependencies": {
"@eslint/js": "^9.39.1",
"@typescript-eslint/eslint-plugin": "^8.48.1",
"@typescript-eslint/parser": "^8.48.1",
"eslint": "^9.39.1",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-prettier": "^5.5.4",
"eslint-plugin-unicorn": "^62.0.0",
"globals": "^16.5.0",
"prettier": "^3.7.4",
"typescript": "^5.9.3",
"vite": "^7.2.6"
}
},
"node_modules/@babel/code-frame": {
"version": "7.27.1",
"resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.27.1.tgz",
@@ -745,15 +766,6 @@
"@jridgewell/sourcemap-codec": "^1.4.14"
}
},
"node_modules/@noble/ed25519": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/@noble/ed25519/-/ed25519-3.0.0.tgz",
"integrity": "sha512-QyteqMNm0GLqfa5SoYbSC3+Pvykwpn95Zgth4MFVSMKBB75ELl9tX1LAVsN4c3HXOrakHsF2gL4zWDAYCcsnzg==",
"license": "MIT",
"funding": {
"url": "https://paulmillr.com/funding/"
}
},
"node_modules/@rolldown/pluginutils": {
"version": "1.0.0-beta.27",
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-beta.27.tgz",
@@ -1171,13 +1183,8 @@
}
},
"node_modules/@xtr-dev/rondevu-client": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/@xtr-dev/rondevu-client/-/rondevu-client-0.8.3.tgz",
"integrity": "sha512-yvTZYQiOeIuaQgTZPhO3Wud9OEi7Mwxt9b4JYWlhwaReVUNajI1fpWTO8hHu8BrkiowVDabDN0qLFpwRufEvsw==",
"license": "MIT",
"dependencies": {
"@noble/ed25519": "^3.0.0"
}
"resolved": "../client",
"link": true
},
"node_modules/@zxing/library": {
"version": "0.21.3",

View File

@@ -10,7 +10,7 @@
"deploy": "npm run build && npx wrangler pages deploy dist --project-name=rondevu-demo"
},
"dependencies": {
"@xtr-dev/rondevu-client": "^0.8.3",
"@xtr-dev/rondevu-client": "file:../client",
"@zxing/library": "^0.21.3",
"qrcode": "^1.5.4",
"react": "^18.2.0",

1368
src/App-old.jsx Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff