Support for web socket communication with no signaling key

This commit is contained in:
Scott Nonnenberg 2019-01-11 08:53:35 -08:00
parent 00755072ee
commit 43e5d16020
7 changed files with 66 additions and 25 deletions

View file

@ -27,6 +27,7 @@
const Request = function Request(options) {
this.verb = options.verb || options.type;
this.path = options.path || options.url;
this.headers = options.headers;
this.body = options.body || options.data;
this.success = options.success;
this.error = options.error;
@ -50,6 +51,7 @@
this.verb = request.verb;
this.path = request.path;
this.body = request.body;
this.headers = request.headers;
this.respond = (status, message) => {
socket.send(
@ -77,6 +79,7 @@
verb: request.verb,
path: request.path,
body: request.body,
headers: request.headers,
id: request.id,
},
})
@ -105,6 +108,7 @@
verb: message.request.verb,
path: message.request.path,
body: message.request.body,
headers: message.request.headers,
id: message.request.id,
socket,
})