Permalink
Browse files

Merge branch 'master' of git://github.com/dominictarr/shoe into domin…

…ictarr.docfix
  • Loading branch information...
2 parents fd22dcc + 729e22a commit 12c5956a79f360bd08a99ddf8dbbef21bd2d10a1 @substack committed Sep 7, 2012
Showing with 26 additions and 2 deletions.
  1. +26 −2 README.markdown
View
@@ -136,6 +136,28 @@ Then open up `localhost:9999` in your browser and you should see:
beep => BOOP
```
+with express or connect
+-----------------------
+
+you must pass the return value of `app.listen(port)`
+
+``` js
+var shoe = require('shoe');
+
+var express = require('express')
+var app = express()
+
+var sock = shoe(function (stream) { ... });
+
+// *** must pass expcess/connect apps like this:
+sock.install(app.listen(9999), '/dnode');
+```
+
+Then open up `localhost:9999` in your browser and you should see:
+
+
+```
+
browser methods
===============
@@ -149,8 +171,10 @@ var stream = shoe(uri, cb)
Return a readable/writable stream from the sockjs path `uri`.
`uri` may be a full uri or just a path.
-`cb()` will fire when the stream is actually open, but writes will be buffered
-before then.
+`shoe` will emit a `'connect'` event when the connection is actually open,
+(just like in [net](http://nodejs.org/api/net.html#net_net_connect_options_connectionlistener)).
+writes performed before the `'connect'` event will be buffered. passing in `cb` to
+shoe is a shortcut for `shoe(uri).on('connect', cb)`
server methods
==============

0 comments on commit 12c5956

Please sign in to comment.