Skip to content

Commit 81d4093

Browse files
committed
fixes to built in webrtc signal logic
1 parent 8b1be62 commit 81d4093

6 files changed

Lines changed: 541 additions & 541 deletions

File tree

server-src/rtcsignal/iows.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class fakeIOSocket {
9292
ws.sockID +
9393
'".',
9494
e,
95-
"Might be a sign of attempting to hack."
95+
"Might be a sign of attempting to hack.",
9696
);
9797
ws.close();
9898
}
@@ -118,11 +118,11 @@ class fakeIOSocket {
118118
this.events[eventName].push(func);
119119
}
120120

121-
removeEvent(eventName, func) {
122-
if (this.events[eventName]) {
123-
this.events[eventName] = this.events[eventName].filter(f => f !== func);
124-
}
125-
}
121+
removeEvent(eventName, func) {
122+
if (this.events[eventName]) {
123+
this.events[eventName] = this.events[eventName].filter((f) => f !== func);
124+
}
125+
}
126126
}
127127

128128
class fakeIOServer {
@@ -196,9 +196,9 @@ class fakeIOServer {
196196
JSON.stringify({
197197
event: "auth",
198198
sockID: id,
199-
})
199+
}),
200200
);
201-
terminateGhostSockets(ws);
201+
terminateGhostSockets(ws);
202202
var cli = new fakeIOSocket(ws);
203203
this.clients.push(cli);
204204
this.events.emit("connection", cli);
@@ -252,4 +252,4 @@ function createFakeIOServer(args) {
252252
return server;
253253
}
254254

255-
module.exports = createFakeIOServer;
255+
module.exports = createFakeIOServer;

server-src/rtcsignal/req-handler.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ function newHostThing(val) {
133133
if (val) {
134134
key = val;
135135
}
136-
var host = hosts[key];
136+
var host = hosts[key];
137137
host = fakeIoCreate();
138-
hosts[key].endFunction = function () {
139-
delete hosts[key];
140-
};
141-
hosts[key] = host;
138+
host.endFunction = function () {
139+
delete hosts[key];
140+
};
141+
hosts[key] = host;
142142
return key;
143143
}
144144

@@ -173,7 +173,7 @@ async function handleUpgrade(request, socket, head) {
173173
var urlsplit = url.split("/");
174174
var method = urlsplit[1];
175175
var hostkey = urlsplit[2];
176-
var host = hosts[hostkey];
176+
var host = hosts[hostkey];
177177
if (method == "webrtc" && host) {
178178
var wss = host.wss;
179179

0 commit comments

Comments
 (0)