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.)
(This request is for
proxy-agent
)Currently,
GetProxyForUrlCallback
returns a string synchronously:https://github.com/TooTallNate/proxy-agents/blob/dd3b98f0f0bf1da83a58c3330415805568b297f6/packages/proxy-agent/src/index.ts#L25
However, it may be necessary to resolve it asynchronously; for example
Electron.Session.resolveProxy(url)
returns aPromise<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:type GetProxyForUrlCallback = (url: string) => string | Promise<string>;
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!