danielnieto / electron-download-manager

Manage downloadItems from Electron's BrowserWindows without user interaction, allowing single file download and bulk downloading
MIT License
119 stars 51 forks source link

[Feature]: Pass full options to net.request (e.g. allow limit of bandwith) #47

Open the-nicolas opened 4 years ago

the-nicolas commented 4 years ago

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...

danielnieto commented 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?

the-nicolas commented 4 years ago

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...