X-Git-Url: https://git.kengrimes.com/?p=henge%2Fkiak.git;a=blobdiff_plain;f=router.js;h=2085e9b166e411f9e46e4adadde35c8fe8fa1aaa;hp=0e8edf8bd725b68222553e127d84b1c52dc7f100;hb=2fa4d84ec6b04eec92a8a1e76f8b33b2a04f3c58;hpb=25a33ef76e7fbb1647fcbac0bd2c3b2cb84ca2d2 diff --git a/router.js b/router.js index 0e8edf8..2085e9b 100644 --- a/router.js +++ b/router.js @@ -221,7 +221,7 @@ exports = { serveClient: function (request, response, route) { const type = request.headers['x-strapp-type'] const pubKey = request.headers['x-strapp-pubkey'] - dlog(`Client ${type || 'HT'} request routed to ${route.name}`) + dlog(`Client ${type || 'HT GET'} request routed to ${route.name}`) switch (type) { case null: case undefined: @@ -236,6 +236,8 @@ exports = { if (pubKey) { let data = request.headers['x-strapp-offer'] route.pendingResponses.addResponse(pubKey, response) + dlog(`${route.origin}=>\n${pubKey}\n${type}`) + dlog(JSON.parse(data)) route.socket.send(`${pubKey} ${type} ${data}`) } else { @@ -336,7 +338,7 @@ exports = { * @arg {Object} route - the route over */ hostMessage: function (message, route) { - const argv = message.split(' ') + let argv = message.split(' ') const command = argv[0][0] argv = argv.slice(1) dlog(`Received host message from ${route.name}: ${command}`)