TooTallNate / node-proxy-agent

Maps proxy protocols to `http.Agent` implementations
285 stars 69 forks source link

Types not compatible for S3 #42

Closed re-jim closed 1 year ago

re-jim commented 5 years ago

S3 recommends to use this package: https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-configuring-proxies.html

However, when I try the suggested code, I get a typings error:

image

Type 'ProxyAgent' is not assignable to type 'Agent'

hoegertn commented 4 years ago

Anything new on this issue? I get the same error...

linonetwo commented 4 years ago

Just as any for now.

karlismelderis commented 4 years ago

if something like this is done to type would be nice:

    export interface Agent extends httpsAgent {
        _promisifiedCallback: boolean;
        timeout: number | null;
        options: AgentOptions;
        callback: AgentCallback;
        addRequest: (req?: any, opts?: any) => void;
        freeSocket: (socket: any, opts: any) => void;
    }

different extend - httpsAgent vs EventEmitter and options are not optional now.

but I guess change is more complex than that :)

karlismelderis commented 4 years ago

I think also AgentOptions should come from node http|https or similar clone

ferrys commented 4 years ago

You can use as Partial<Agent> as Agent to avoid as any

TooTallNate commented 1 year ago

This code in this repository has been moved to the proxy-agents monorepo, so I am closing this pull request. If you feel that this issue still exists as of the latest release, feel free to open a new issue over there.