I've done this in my project Audio Sponge, see serve-stream.coffee and usage in server.coffee.
It's not production hardened, and a user might be able to crash the server after a while by just pausing the stream.
You can use decaffeinate if you want to convert the CoffeeScript to JavaScript in a clean way (i.e. for use as source code for further editing, as opposed to the CoffeeScript compiler where the output is for running)
I've done this in my project Audio Sponge, see
serve-stream.coffee
and usage inserver.coffee
. It's not production hardened, and a user might be able to crash the server after a while by just pausing the stream. You can use decaffeinate if you want to convert the CoffeeScript to JavaScript in a clean way (i.e. for use as source code for further editing, as opposed to the CoffeeScript compiler where the output is for running)