Update client.js

This commit is contained in:
Mark Nadal 2017-01-11 10:47:50 -08:00 committed by GitHub
parent 8c426553d7
commit baf99d7e72

View File

@ -49,6 +49,7 @@ Gun.on('out', function (ctx) {
var gun = ctx.gun;
var opt = ctx.opt || {};
var peers = opt.peers || gun.Back('opt.peers');
var headers = opt.headers || gun.Back('opt.headers') || {};
if (!peers) {
return;
@ -56,8 +57,9 @@ Gun.on('out', function (ctx) {
var subset = getSocketSubset(peers);
headers['gun-sid'] = sid;
subset.send({
headers: { 'gun-sid': sid },
headers: headers,
body: ctx,
});
});