@pjts/webrtc-signalling 0.0.0-stage → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/InMemorySignalStore.d.ts +9 -0
- package/dist/InMemorySignalStore.js +21 -0
- package/dist/InMemorySignalStore.js.map +1 -0
- package/dist/hub.d.ts +72 -0
- package/dist/hub.js +90 -0
- package/dist/hub.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/package.json +35 -4
package/README.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Domain-Driven Design TypeScript Utilities / WebRTC Signalling
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Two-party WebRTC signalling hub on top of `@pjts/websocket-server`. The application supplies a
|
|
4
|
+
`SignalStorePort` (persistence + replay by `seq`) and a `RoomPolicyPort` (who may act as which party,
|
|
5
|
+
what may be relayed when); the hub relays offers/answers/ICE between the two parties of a room.
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
const broadcaster = await createBroadcaster() // in-process (single replica) or redis URL
|
|
9
|
+
const hub = createSignallingHub({ store, rooms, broadcaster, parties: ['host', 'guest'] })
|
|
10
|
+
await buildWsServer({ server: fastify.server, prefix: '/api/v1/rtc/ws', ...pick(hub, 'authorize', 'onMessage', 'onSubscribed') })
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Client side: `@pjts/webrtc-client`. Channels: `<prefix>.<roomId>.<party>` (default prefix `rtc`).
|
|
14
|
+
A party subscribes to its own inbox — `subscribe(channel, cb, () => ({ afterSeq }))` — and sends
|
|
15
|
+
`{ type, payload }` with the `message` action on the same channel.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AppendSignal, Signal, SignalStorePort } from './hub';
|
|
2
|
+
/** Reference store for tests and single-process demos — not durable. */
|
|
3
|
+
export declare class InMemorySignalStore implements SignalStorePort {
|
|
4
|
+
private readonly signals;
|
|
5
|
+
private seq;
|
|
6
|
+
append(signal: AppendSignal): Promise<Signal>;
|
|
7
|
+
replay(roomId: string, to: string, afterSeq: number): Promise<Signal[]>;
|
|
8
|
+
countFrom(roomId: string, from: string): Promise<number>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InMemorySignalStore = void 0;
|
|
4
|
+
/** Reference store for tests and single-process demos — not durable. */
|
|
5
|
+
class InMemorySignalStore {
|
|
6
|
+
signals = [];
|
|
7
|
+
seq = 0;
|
|
8
|
+
async append(signal) {
|
|
9
|
+
const stored = { ...signal, seq: ++this.seq, at: new Date().toISOString() };
|
|
10
|
+
this.signals.push(stored);
|
|
11
|
+
return stored;
|
|
12
|
+
}
|
|
13
|
+
async replay(roomId, to, afterSeq) {
|
|
14
|
+
return this.signals.filter(s => s.roomId === roomId && s.to === to && s.seq > afterSeq);
|
|
15
|
+
}
|
|
16
|
+
async countFrom(roomId, from) {
|
|
17
|
+
return this.signals.filter(s => s.roomId === roomId && s.from === from).length;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
exports.InMemorySignalStore = InMemorySignalStore;
|
|
21
|
+
//# sourceMappingURL=InMemorySignalStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InMemorySignalStore.js","sourceRoot":"","sources":["../src/InMemorySignalStore.ts"],"names":[],"mappings":";;;AAEA,wEAAwE;AACxE,MAAa,mBAAmB;IACb,OAAO,GAAa,EAAE,CAAA;IAC/B,GAAG,GAAG,CAAC,CAAA;IAER,KAAK,CAAC,MAAM,CAAC,MAAoB;QACtC,MAAM,MAAM,GAAW,EAAE,GAAG,MAAM,EAAE,GAAG,EAAE,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,EAAE,CAAA;QACnF,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACzB,OAAO,MAAM,CAAA;IACf,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,MAAc,EAAE,EAAU,EAAE,QAAgB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,GAAG,GAAG,QAAQ,CAAC,CAAA;IACzF,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,MAAc,EAAE,IAAY;QACjD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC,MAAM,CAAA;IAChF,CAAC;CACF;AAjBD,kDAiBC"}
|
package/dist/hub.d.ts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { WebSocketBroadcaster } from '@pjts/websocket-server';
|
|
2
|
+
/** A persisted signal. `seq` is monotonic per room and is the replay cursor. */
|
|
3
|
+
export interface Signal {
|
|
4
|
+
seq: number;
|
|
5
|
+
roomId: string;
|
|
6
|
+
/** A party name, or `server` for hub-originated events. */
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
type: string;
|
|
10
|
+
payload: unknown;
|
|
11
|
+
at: string;
|
|
12
|
+
}
|
|
13
|
+
export interface AppendSignal {
|
|
14
|
+
roomId: string;
|
|
15
|
+
from: string;
|
|
16
|
+
to: string;
|
|
17
|
+
type: string;
|
|
18
|
+
payload: unknown;
|
|
19
|
+
}
|
|
20
|
+
/** Persistence for signals. The hub keeps no state of its own. */
|
|
21
|
+
export interface SignalStorePort {
|
|
22
|
+
append(signal: AppendSignal): Promise<Signal>;
|
|
23
|
+
/** Signals addressed to `to` with `seq > afterSeq`, ascending. */
|
|
24
|
+
replay(roomId: string, to: string, afterSeq: number): Promise<Signal[]>;
|
|
25
|
+
/** How many signals `from` has sent in the room (bounds ICE storms). */
|
|
26
|
+
countFrom(roomId: string, from: string): Promise<number>;
|
|
27
|
+
}
|
|
28
|
+
/** The application decides who is who and what may be relayed when (e.g. a waiting room). */
|
|
29
|
+
export interface RoomPolicyPort {
|
|
30
|
+
/** May the bearer of `token` act as `party` in `roomId`? Used for subscribe and message alike. */
|
|
31
|
+
authorize(roomId: string, party: string, token: string | null): Promise<boolean>;
|
|
32
|
+
/** May `from` relay a signal of `type` right now? */
|
|
33
|
+
mayRelay(roomId: string, from: string, type: string): Promise<boolean>;
|
|
34
|
+
}
|
|
35
|
+
export interface SignallingHubConfig {
|
|
36
|
+
store: SignalStorePort;
|
|
37
|
+
rooms: RoomPolicyPort;
|
|
38
|
+
broadcaster: Pick<WebSocketBroadcaster, 'broadcast'>;
|
|
39
|
+
/** The two party slots of every room, e.g. `['host', 'guest']`. */
|
|
40
|
+
parties: [string, string];
|
|
41
|
+
/** Channel prefix — channels are `<prefix>.<roomId>.<party>`. Default `rtc`. */
|
|
42
|
+
channelPrefix?: string;
|
|
43
|
+
/** Max JSON size of a relayed payload. Default 16 KiB. */
|
|
44
|
+
maxPayloadBytes?: number;
|
|
45
|
+
/** Max signals one party may send per room. Default 500. */
|
|
46
|
+
maxSignalsPerParty?: number;
|
|
47
|
+
}
|
|
48
|
+
export declare const SERVER_PARTY = "server";
|
|
49
|
+
export declare class SignallingError extends Error {
|
|
50
|
+
}
|
|
51
|
+
interface ParsedChannel {
|
|
52
|
+
roomId: string;
|
|
53
|
+
party: string;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Two-party WebRTC signalling over `@pjts/websocket-server`. Each party subscribes to its own inbox
|
|
57
|
+
* `<prefix>.<roomId>.<party>` (optionally with `{ afterSeq }` to replay history) and sends upstream
|
|
58
|
+
* `message` actions on the same channel with `{ type, payload }`. The hub asks the policy, persists the
|
|
59
|
+
* signal, and pushes it to the *other* party's inbox. Server-side events go through `emit`.
|
|
60
|
+
*
|
|
61
|
+
* Wire it by spreading `authorize`, `onMessage` and `onSubscribed` into `buildWsServer`.
|
|
62
|
+
*/
|
|
63
|
+
export declare const createSignallingHub: (config: SignallingHubConfig) => {
|
|
64
|
+
authorize: (channel: string, token: string | null) => Promise<boolean>;
|
|
65
|
+
onMessage: (channel: string, data: Record<string, unknown>, token: string | null) => Promise<void>;
|
|
66
|
+
onSubscribed: (channel: string, params: Record<string, unknown>, deliver: (msg: Record<string, unknown>) => void, token: string | null) => Promise<void>;
|
|
67
|
+
emit: (roomId: string, to: string, type: string, payload?: unknown) => Promise<Signal>;
|
|
68
|
+
channelFor: (roomId: string, party: string) => string;
|
|
69
|
+
parse: (channel: string) => ParsedChannel | null;
|
|
70
|
+
};
|
|
71
|
+
export type SignallingHub = ReturnType<typeof createSignallingHub>;
|
|
72
|
+
export {};
|
package/dist/hub.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSignallingHub = exports.SignallingError = exports.SERVER_PARTY = void 0;
|
|
4
|
+
exports.SERVER_PARTY = 'server';
|
|
5
|
+
class SignallingError extends Error {
|
|
6
|
+
}
|
|
7
|
+
exports.SignallingError = SignallingError;
|
|
8
|
+
const TYPE_RE = /^[a-z][a-z0-9_.-]{0,63}$/i;
|
|
9
|
+
/**
|
|
10
|
+
* Two-party WebRTC signalling over `@pjts/websocket-server`. Each party subscribes to its own inbox
|
|
11
|
+
* `<prefix>.<roomId>.<party>` (optionally with `{ afterSeq }` to replay history) and sends upstream
|
|
12
|
+
* `message` actions on the same channel with `{ type, payload }`. The hub asks the policy, persists the
|
|
13
|
+
* signal, and pushes it to the *other* party's inbox. Server-side events go through `emit`.
|
|
14
|
+
*
|
|
15
|
+
* Wire it by spreading `authorize`, `onMessage` and `onSubscribed` into `buildWsServer`.
|
|
16
|
+
*/
|
|
17
|
+
const createSignallingHub = (config) => {
|
|
18
|
+
const prefix = config.channelPrefix ?? 'rtc';
|
|
19
|
+
const maxPayloadBytes = config.maxPayloadBytes ?? 16 * 1024;
|
|
20
|
+
const maxSignalsPerParty = config.maxSignalsPerParty ?? 500;
|
|
21
|
+
const [partyA, partyB] = config.parties;
|
|
22
|
+
const channelFor = (roomId, party) => `${prefix}.${roomId}.${party}`;
|
|
23
|
+
const parse = (channel) => {
|
|
24
|
+
const chunks = channel.split('.');
|
|
25
|
+
if (chunks.length < 3 || chunks[0] !== prefix)
|
|
26
|
+
return null;
|
|
27
|
+
const party = chunks[chunks.length - 1];
|
|
28
|
+
const roomId = chunks.slice(1, -1).join('.');
|
|
29
|
+
if (!roomId || (party !== partyA && party !== partyB))
|
|
30
|
+
return null;
|
|
31
|
+
return { roomId, party };
|
|
32
|
+
};
|
|
33
|
+
const otherParty = (party) => (party === partyA ? partyB : partyA);
|
|
34
|
+
const deliverable = (signal) => ({ uuid: `${signal.roomId}:${signal.seq}`, ...signal });
|
|
35
|
+
const push = async (signal) => {
|
|
36
|
+
await config.broadcaster.broadcast([channelFor(signal.roomId, signal.to)], deliverable(signal));
|
|
37
|
+
};
|
|
38
|
+
const authorize = async (channel, token) => {
|
|
39
|
+
const parsed = parse(channel);
|
|
40
|
+
if (!parsed)
|
|
41
|
+
return false;
|
|
42
|
+
return config.rooms.authorize(parsed.roomId, parsed.party, token);
|
|
43
|
+
};
|
|
44
|
+
/** Called by the WS server after `authorize` passed for the channel. */
|
|
45
|
+
const onMessage = async (channel, data) => {
|
|
46
|
+
const parsed = parse(channel);
|
|
47
|
+
if (!parsed)
|
|
48
|
+
throw new SignallingError('Unknown channel');
|
|
49
|
+
const type = data.type;
|
|
50
|
+
if (typeof type !== 'string' || !TYPE_RE.test(type))
|
|
51
|
+
throw new SignallingError('Invalid signal type');
|
|
52
|
+
const payload = data.payload ?? null;
|
|
53
|
+
if (JSON.stringify(payload).length > maxPayloadBytes)
|
|
54
|
+
throw new SignallingError('Signal too large');
|
|
55
|
+
if (!(await config.rooms.mayRelay(parsed.roomId, parsed.party, type))) {
|
|
56
|
+
throw new SignallingError('Signal not allowed');
|
|
57
|
+
}
|
|
58
|
+
if ((await config.store.countFrom(parsed.roomId, parsed.party)) >= maxSignalsPerParty) {
|
|
59
|
+
throw new SignallingError('Too many signals');
|
|
60
|
+
}
|
|
61
|
+
const signal = await config.store.append({
|
|
62
|
+
roomId: parsed.roomId,
|
|
63
|
+
from: parsed.party,
|
|
64
|
+
to: otherParty(parsed.party),
|
|
65
|
+
type,
|
|
66
|
+
payload,
|
|
67
|
+
});
|
|
68
|
+
await push(signal);
|
|
69
|
+
};
|
|
70
|
+
/** Replays history after `params.afterSeq` (default 0) to the subscribing socket only. */
|
|
71
|
+
const onSubscribed = async (channel, params, deliver) => {
|
|
72
|
+
const parsed = parse(channel);
|
|
73
|
+
if (!parsed)
|
|
74
|
+
return;
|
|
75
|
+
const afterSeq = Number(params.afterSeq) || 0;
|
|
76
|
+
const history = await config.store.replay(parsed.roomId, parsed.party, afterSeq);
|
|
77
|
+
history.forEach(signal => deliver(deliverable(signal)));
|
|
78
|
+
};
|
|
79
|
+
/** Server-originated event (presence, admission, end…) — persisted and pushed like any signal. */
|
|
80
|
+
const emit = async (roomId, to, type, payload = null) => {
|
|
81
|
+
if (to !== partyA && to !== partyB)
|
|
82
|
+
throw new SignallingError(`Unknown party '${to}'`);
|
|
83
|
+
const signal = await config.store.append({ roomId, from: exports.SERVER_PARTY, to, type, payload });
|
|
84
|
+
await push(signal);
|
|
85
|
+
return signal;
|
|
86
|
+
};
|
|
87
|
+
return { authorize, onMessage, onSubscribed, emit, channelFor, parse };
|
|
88
|
+
};
|
|
89
|
+
exports.createSignallingHub = createSignallingHub;
|
|
90
|
+
//# sourceMappingURL=hub.js.map
|
package/dist/hub.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hub.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AM,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAA;QAChF,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,MAAM,CAAC,CAAC,CAAC,CAAA;IACzD,CAAC,CAAA;IAED,kGAAkG;IAClG,MAAM,IAAI,GAAG,KAAK,EAAE,MAAc,EAAE,EAAU,EAAE,IAAY,EAAE,UAAmB,IAAI,EAAmB,EAAE;QACxG,IAAI,EAAE,KAAK,MAAM,IAAI,EAAE,KAAK,MAAM;YAAE,MAAM,IAAI,eAAe,CAAC,kBAAkB,EAAE,GAAG,CAAC,CAAA;QACtF,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,oBAAY,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAA;QAC3F,MAAM,IAAI,CAAC,MAAM,CAAC,CAAA;QAClB,OAAO,MAAM,CAAA;IACf,CAAC,CAAA;IAED,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,CAAA;AACxE,CAAC,CAAA;AAzEY,QAAA,mBAAmB,uBAyE/B"}
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,gDAAqB;AACrB,gEAAqC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pjts/webrtc-signalling",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "Piotr Józefów DDD utility package — two-party WebRTC signalling hub over @pjts/websocket-server",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"author": "Piotr Józefów",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": "^18.14.0"
|
|
11
|
+
},
|
|
12
|
+
"engineStrict": true,
|
|
13
|
+
"scripts": {
|
|
14
|
+
"lint": "eslint src/ --ext .js,.jsx,.ts,.tsx",
|
|
15
|
+
"test": "NODE_ENV=test jest --coverage=false --verbose",
|
|
16
|
+
"test:watch": "NODE_ENV=test jest --coverage=false --watchAll --testNamePattern=",
|
|
17
|
+
"build": "rm -rf ./dist && tsc",
|
|
18
|
+
"package": "npm run build && npm publish --access=public",
|
|
19
|
+
"prepare": "npm install @pjts/core@latest @pjts/websocket-client@latest @pjts/websocket-server@latest --save-dev & npm version patch"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"@pjts/websocket-server": ">=0.0.59"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@pjts/core": "^0.0.90",
|
|
26
|
+
"@pjts/websocket-client": "^0.0.59",
|
|
27
|
+
"@pjts/websocket-server": "^0.0.60",
|
|
28
|
+
"@types/jest": "29.4.0",
|
|
29
|
+
"@types/node": "18.13.0",
|
|
30
|
+
"jest": "29.4.2",
|
|
31
|
+
"ts-jest": "29.0.5",
|
|
32
|
+
"typescript": "4.9.5"
|
|
33
|
+
},
|
|
34
|
+
"publishConfig": {
|
|
35
|
+
"registry": "https://registry.npmjs.org"
|
|
36
|
+
}
|
|
37
|
+
}
|