Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

notes for production use

  • Loading branch information...
commit d3f65b8a0eede019ce340d8b9611c3335bec6648 1 parent a138e93
@dominictarr authored
Showing with 18 additions and 0 deletions.
  1. +18 −0 readme.markdown
View
18 readme.markdown
@@ -55,6 +55,24 @@ net.createServer(function (stream) {
}).listen(port)
```
+### Errors, and use in PRODUCTION
+
+`mux-demux` parses a `JSON` protocol, and so you must handle any errors
+that may result from someone connecting, and sending invalid data.
+
+``` js
+net.createServer(function (stream) {
+ var mx = MuxDemux()
+ stream.pipe(mx).pipe(stream)
+ mx.on('error', function () {
+ stream.destroy()
+ })
+ stream.on('error', function () {
+ mx.destroy()
+ })
+}).listen(9999)
+```
+
#API
the API [browser-stream](http://github.com/dominictarr/browser-stream#api)
Please sign in to comment.
Something went wrong with that request. Please try again.