How would I limit upload speed from the server in node.js?
How would I limit upload speed from the server in node.js? Is this even an option? Scenario: I'm writing some methods to allow users to automated-ly upload files to my server. I want to limit the upload speed to (for instance) 50kB/s (configurable of course). I do not think you can force a client to stream at a predefined speed, however you can control the "average speed" of the entire process. var startTime = Date.now(), totalBytes = ..., //NOTE: you need the client to give you the total amount of incoming bytes curBytes = 0; stream.on('data', function(chunk) { //NOTE: chunk is expected to be