UNPKG

rapport

Version:

Request/response wrapper for websockets

17 lines (15 loc) 394 B
'use strict'; /** * Responds to a request. * * @param {object} wrappedSocket The wrapped socket. * @param {object} options Websocket options. * @param {string} responseId The response ID. * @param {*} body The body of the response to send. */ module.exports = (wrappedSocket, options, responseId, body) => { wrappedSocket.send({ _rs: responseId, _b: body }); };