max-mapper / websocket-stream

websockets with the node stream API
BSD 2-Clause "Simplified" License
667 stars 114 forks source link

Slightly cooler API #119

Closed brettz9 closed 7 years ago

brettz9 commented 7 years ago

How about allowing the handler to be checked for a return (stream) value?

var wss = websocket.createServer({
    server: someHTTPServer
}, () => fs.createReadStream('bigdata.json'))
mcollina commented 7 years ago

It would to be aware of the direction of the returned stream, if its's readable and/or writable. I think you can easily build a module on top of this one, as this is nice and simple.