Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
dominictarr committed Apr 27, 2012
1 parent 5041c0f commit e91fefa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 3 additions & 2 deletions example/client.js
Expand Up @@ -3,11 +3,12 @@ var bs = require('browser-stream')(io.connect('http://localhost:3000'))


var dominode = require('dominode.js')('#body', '<div id="item"></div>') var dominode = require('dominode.js')('#body', '<div id="item"></div>')


rs = bs.createReadStream('whatever') rs = bs.createStream('whatever')


rs.pipe(dominode) rs.pipe(dominode)
rs.on('data', function(d) { rs.on('data', function(d) {
console.log(d) console.log(d)
}) })



rs.write('hello')
rs.write('goodbye')
6 changes: 4 additions & 2 deletions example/server.js
Expand Up @@ -6,6 +6,7 @@ var io = require('socket.io')
var _bs = require('browser-stream') var _bs = require('browser-stream')
var assert = require('assert') var assert = require('assert')
var browserify = require('browserify') var browserify = require('browserify')
var es = require('event-stream')
var fs = require('fs') var fs = require('fs')
//TODO: allow both _bs(io) and _bs(connection) //TODO: allow both _bs(io) and _bs(connection)


Expand All @@ -31,8 +32,9 @@ console.log(io)
io.on('connection', function (sock) { io.on('connection', function (sock) {
var bs = _bs(sock) var bs = _bs(sock)


bs.on('open', function (stream) { bs.on('connection', function (stream) {
console.log('OPEN', stream) stream.pipe(es.stringify()).pipe(es.log())
console.log('OPEN', stream, stream.__proto__)
var i = 0 var i = 0
var t var t
t = setInterval(function () { t = setInterval(function () {
Expand Down

0 comments on commit e91fefa

Please sign in to comment.