mirror of
https://github.com/xtr-dev/rondevu-client.git
synced 2025-12-10 10:53:24 +00:00
Integrate secret parameter into peer classes
- Add secret field to PeerOptions interface - Pass secret when creating offers in CreatingOfferState - Pass secret when answering offers in AnsweringState - Bump version to 0.7.7 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@xtr-dev/rondevu-client",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.7",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@xtr-dev/rondevu-client",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.7",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@xtr-dev/rondevu-client": "^0.5.1"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@xtr-dev/rondevu-client",
|
||||
"version": "0.7.6",
|
||||
"version": "0.7.7",
|
||||
"description": "TypeScript client for Rondevu topic-based peer discovery and signaling server",
|
||||
"type": "module",
|
||||
"main": "dist/index.js",
|
||||
|
||||
@@ -28,7 +28,7 @@ export class AnsweringState extends PeerState {
|
||||
|
||||
// Send answer to server BEFORE setLocalDescription
|
||||
// This registers us as the answerer so ICE candidates will be accepted
|
||||
await this.peer.offersApi.answer(offerId, answer.sdp!);
|
||||
await this.peer.offersApi.answer(offerId, answer.sdp!, options.secret);
|
||||
|
||||
// Enable trickle ICE - set up handler before ICE gathering starts
|
||||
this.setupIceCandidateHandler();
|
||||
|
||||
@@ -36,7 +36,8 @@ export class CreatingOfferState extends PeerState {
|
||||
const offers = await this.peer.offersApi.create([{
|
||||
sdp: offer.sdp!,
|
||||
topics: options.topics,
|
||||
ttl: options.ttl || 300000
|
||||
ttl: options.ttl || 300000,
|
||||
secret: options.secret
|
||||
}]);
|
||||
|
||||
const offerId = offers[0].id;
|
||||
|
||||
@@ -22,6 +22,8 @@ export interface PeerOptions {
|
||||
topics: string[];
|
||||
/** How long the offer should live (milliseconds) */
|
||||
ttl?: number;
|
||||
/** Optional secret to protect the offer (max 128 characters) */
|
||||
secret?: string;
|
||||
/** Whether to create a data channel automatically (for offerer) */
|
||||
createDataChannel?: boolean;
|
||||
/** Label for the automatically created data channel */
|
||||
|
||||
Reference in New Issue
Block a user