diff --git a/CHANGELOG.md b/CHANGELOG.md index f1e4ed7b..6a4be436 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 0.3.5 + + - Fixed server push. + ## 0.3.4 - Breaking Change! `list.set(item)` returns the item's chain now, not the list chain. diff --git a/examples/http.js b/examples/http.js index 533ece38..3a9811ad 100644 --- a/examples/http.js +++ b/examples/http.js @@ -1,4 +1,3 @@ -'use strict'; var path = require('path'); var http = require('http'); var fs = require('fs'); @@ -28,5 +27,4 @@ var server = http.createServer(function(req, res){ gun.wsp(server); server.listen(port, ip); -console.log('Server started on port ' + port + ' with /gun'); - +console.log('Server started on port ' + port + ' with /gun'); \ No newline at end of file diff --git a/lib/wsp.js b/lib/wsp.js index 54280b20..c502dae5 100644 --- a/lib/wsp.js +++ b/lib/wsp.js @@ -209,5 +209,23 @@ if(opt.server){ wsp(opt.server); } + + setTimeout(function(){ // hack it in :( for now, since 0.4.x will allow us to have multiple drivers. + var proxy = gun.__.opt.wire; + var driver = { + put: function(graph, cb, opt){ + proxy.put(graph, cb, opt); + var msg = { + headers: {'Content-Type': 'application/json', id: gun.wsp.msg()}, + body: graph + }; + gun.wsp.on('network').emit(msg); + }, + get: proxy.get + } + gun.__.opt.wire = driver; + gun.opt({wire: driver}, true); + },1); + }); }({})); \ No newline at end of file diff --git a/package.json b/package.json index 550e3a2b..b8c13c54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "gun", - "version": "0.3.4", + "version": "0.3.5", "description": "Graph engine", "main": "index.js", "scripts": {