Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

default uri and shortcuts

  • Loading branch information...
commit fd5abda2b5de27ad35a462bdeeb819d3311b0bb1 1 parent edaf946
@Raynos authored
Showing with 26 additions and 5 deletions.
  1. +2 −4 browser.js
  2. +24 −1 index.js
View
6 browser.js
@@ -14,7 +14,7 @@ var shoe = require("mux-demux-shoe")
module.exports = reconnecter
function reconnecter(uri) {
- var proxyWrite = PauseStream()
+ var proxyWrite = PauseStream().pause()
, proxyRead = through()
, proxy = duplex(proxyWrite, proxyRead)
, metaStreams = []
@@ -22,9 +22,7 @@ function reconnecter(uri) {
, connected = false
, backoff = Backoff(BACKOFF_OPTIONS)
- if (!connected) {
- proxyWrite.pause()
- }
+ uri = uri || "/boot"
proxy.createStream = createStream
proxy.createWriteStream = createWriteStream
View
25 index.js
@@ -1 +1,24 @@
-module.exports = require("mux-demux-shoe")
+var shoe = require("mux-demux-shoe")
+
+shoe.install = install
+
+module.exports = shoe
+
+function install(server, options, uri, callback) {
+ if (typeof options === "function") {
+ callback = options
+ uri = "/boot"
+ options = {}
+ } else if (typeof options === "string") {
+ callback = uri
+ uri = options
+ options = {}
+ } else if (typeof uri === "function") {
+ callback = uri
+ uri = "/boot"
+ }
+
+ var sock = shoe()
+ sock.listen(server, uri)
+ return sock
+}
Please sign in to comment.
Something went wrong with that request. Please try again.