Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

update

  • Loading branch information...
commit e91fefa6ed6c06f9bf5d5794ca06759b34fdce01 1 parent 5041c0f
@dominictarr authored
Showing with 7 additions and 4 deletions.
  1. +3 −2 example/client.js
  2. +4 −2 example/server.js
View
5 example/client.js
@@ -3,11 +3,12 @@ var bs = require('browser-stream')(io.connect('http://localhost:3000'))
var dominode = require('dominode.js')('#body', '<div id="item"></div>')
-rs = bs.createReadStream('whatever')
+rs = bs.createStream('whatever')
rs.pipe(dominode)
rs.on('data', function(d) {
console.log(d)
})
-
+rs.write('hello')
+rs.write('goodbye')
View
6 example/server.js
@@ -6,6 +6,7 @@ var io = require('socket.io')
var _bs = require('browser-stream')
var assert = require('assert')
var browserify = require('browserify')
+var es = require('event-stream')
var fs = require('fs')
//TODO: allow both _bs(io) and _bs(connection)
@@ -31,8 +32,9 @@ console.log(io)
io.on('connection', function (sock) {
var bs = _bs(sock)
- bs.on('open', function (stream) {
- console.log('OPEN', stream)
+ bs.on('connection', function (stream) {
+ stream.pipe(es.stringify()).pipe(es.log())
+ console.log('OPEN', stream, stream.__proto__)
var i = 0
var t
t = setInterval(function () {
Please sign in to comment.
Something went wrong with that request. Please try again.