Open the-nicolas opened 4 years ago
I get why it makes sense to pass the whole options object instead of a single property, but for your use case you mention that you want to limit the bandwidth, according to ClientRequest docs it does not have any property to allow this... do you mean that you want to pass the session so your backend can limit the bandwidth?
I had not tested it, but I thought I can pass a session to net.request() and configure that before: https://www.electronjs.org/docs/api/session#sesenablenetworkemulationoptions
I need some way to slow down heavy downloads in the background...
Right now net.reqeust() gets just called with the path attribute of the options object: https://github.com/danielnieto/electron-download-manager/blob/master/index.js#L138
It would be good to allow all other options too. In my use case I would pass a session with the options to limit the maximum bandwith...