Skip to content
Browse files

fixed, seems to work

  • Loading branch information...
1 parent 68688eb commit b4978d44087c2e5fc46ba9b1de0b91b97c306bda @substack committed Oct 5, 2012
Showing with 2 additions and 5 deletions.
  1. +1 −2 browser.js
  2. +1 −3 server.js
View
3 browser.js
@@ -1,6 +1,5 @@
var shoe = require('shoe');
var emitStream = require('emit-stream');
-var JSONStream = require('JSONStream');
var MuxDemux = require('mux-demux');
var dnode = require('dnode');
@@ -11,7 +10,7 @@ var control = require('./browser/control');
var mdm = MuxDemux();
mdm.on('connection', function (c) {
if (c.meta === 'emit') {
- var emitter = emitStream(c.pipe(JSONStream.parse([true])));
+ var emitter = emitStream(c);
emitter.on('image', function (data) {
img.setAttribute('src', 'data:image/png;base64,' + data);
View
4 server.js
@@ -12,7 +12,6 @@ var emitStream = require('emit-stream');
var server = http.createServer(ecstatic(__dirname + '/static'));
server.listen(8000);
-var JSONStream = require('JSONStream');
var MuxDemux = require('mux-demux');
var dnode = require('dnode');
@@ -35,8 +34,7 @@ var sock = shoe(function (stream) {
d.pipe(mdm.createStream('dnode')).pipe(d);
emitStream(emitter)
- .pipe(JSONStreamf.stringify())
- .pipe(mdm.createReadStream('emit'))
+ .pipe(mdm.createWriteStream('emit'))
;
});
sock.install(server, '/sock');

0 comments on commit b4978d4

Please sign in to comment.
Something went wrong with that request. Please try again.