@rljson/server 0.0.3 → 0.0.4
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/dist/server.d.ts +1 -0
- package/dist/server.js +8 -4
- package/package.json +3 -3
package/dist/server.d.ts
CHANGED
|
@@ -40,6 +40,7 @@ export declare class Server extends BaseNode {
|
|
|
40
40
|
private _removeAllListeners;
|
|
41
41
|
/**
|
|
42
42
|
* Broadcasts incoming payloads from any client to all other connected clients.
|
|
43
|
+
* Ensures the sender is filtered out when broadcasting.
|
|
43
44
|
*/
|
|
44
45
|
private _multicastRefs;
|
|
45
46
|
get route(): Route;
|
package/dist/server.js
CHANGED
|
@@ -1192,9 +1192,10 @@ class Server extends BaseNode {
|
|
|
1192
1192
|
// ...........................................................................
|
|
1193
1193
|
/**
|
|
1194
1194
|
* Broadcasts incoming payloads from any client to all other connected clients.
|
|
1195
|
+
* Ensures the sender is filtered out when broadcasting.
|
|
1195
1196
|
*/
|
|
1196
1197
|
_multicastRefs = () => {
|
|
1197
|
-
for (const { socket: socketA } of this._clients.
|
|
1198
|
+
for (const [clientIdA, { socket: socketA }] of this._clients.entries()) {
|
|
1198
1199
|
socketA.on(this._route.flat, (payload) => {
|
|
1199
1200
|
const ref = payload.r;
|
|
1200
1201
|
if (this._multicastedRefs.has(ref)) {
|
|
@@ -1205,10 +1206,13 @@ class Server extends BaseNode {
|
|
|
1205
1206
|
if (p && p.__origin) {
|
|
1206
1207
|
return;
|
|
1207
1208
|
}
|
|
1208
|
-
for (const
|
|
1209
|
-
|
|
1209
|
+
for (const [
|
|
1210
|
+
clientIdB,
|
|
1211
|
+
{ socket: socketB }
|
|
1212
|
+
] of this._clients.entries()) {
|
|
1213
|
+
if (clientIdA !== clientIdB) {
|
|
1210
1214
|
const forwarded = Object.assign({}, payload, {
|
|
1211
|
-
__origin:
|
|
1215
|
+
__origin: clientIdA
|
|
1212
1216
|
});
|
|
1213
1217
|
socketB.emit(this._route.flat, forwarded);
|
|
1214
1218
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rljson/server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"description": "Rljson server description",
|
|
5
5
|
"homepage": "https://github.com/rljson/server",
|
|
6
6
|
"bugs": "https://github.com/rljson/server/issues",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@vitest/coverage-v8": "^4.0.18",
|
|
27
27
|
"cross-env": "^10.1.0",
|
|
28
28
|
"eslint": "^9.39.2",
|
|
29
|
-
"eslint-plugin-jsdoc": "^62.
|
|
29
|
+
"eslint-plugin-jsdoc": "^62.4.1",
|
|
30
30
|
"eslint-plugin-tsdoc": "^0.5.0",
|
|
31
31
|
"globals": "^17.1.0",
|
|
32
32
|
"jsdoc": "^4.0.5",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"vite": "^7.3.1",
|
|
39
39
|
"vite-node": "^5.3.0",
|
|
40
40
|
"vite-plugin-dts": "^4.5.4",
|
|
41
|
-
"vite-tsconfig-paths": "^6.0.
|
|
41
|
+
"vite-tsconfig-paths": "^6.0.5",
|
|
42
42
|
"vitest": "^4.0.18",
|
|
43
43
|
"vitest-dom": "^0.1.1"
|
|
44
44
|
},
|