Feature Request: Allow `getProxyForUrl` to be asynchronous
mook-as opened this issue · 1 comments
mook-as commented
(This request is for proxy-agent
)
Currently, GetProxyForUrlCallback
returns a string synchronously:
However, it may be necessary to resolve it asynchronously; for example Electron.Session.resolveProxy(url)
returns a Promise<string>
.
Since that is only used in async connect()
, making that asynchronous shouldn't be too onerous; for backwards compatibility, it should be possible to:
- Make it
type GetProxyForUrlCallback = (url: string) => string | Promise<string>;
- Change the single call site to
const proxy = await Promise.resolve(this.getProxyForUrl(url));
Please let me know if that seems reasonable and I can attempt to whip up a PR. (If you think that it would be easier to implement the feature directly, that's excellent too.)
Thanks!
TooTallNate commented
Sounds reasonable. I'd accept a PR.