Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug(types) missing timeout in ProxyAgent Options #1800

Closed
sosoba opened this issue Dec 7, 2022 · 1 comment
Closed

bug(types) missing timeout in ProxyAgent Options #1800

sosoba opened this issue Dec 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@sosoba
Copy link
Contributor

sosoba commented Dec 7, 2022

Bug Description

ProxyAgent constructor support timeout attribute which are not exposed in types.

Reproducible By

new ProxyAgent({
  uri: 'http://proxy.example.com',
  proxyTls: {
    timeout: 1000, // Object literal may only specify known properties, and 'timeout' does not exist in type 'TlsOptions & { servername?: string; }'.ts(2322)
  }
});

Expected Behavior

No errors

Additional context

ProxyAgent constructor pass options to buildConnector function which allow to pass timeout parameter:

class ProxyAgent extends DispatcherBase {
constructor (opts) {

const connect = buildConnector({ ...opts.proxyTls })
this[kConnectEndpoint] = buildConnector({ ...opts.requestTls })

function buildConnector ({ maxCachedSessions, socketPath, timeout, ...opts }) {

Unfortunately type definition do not mention this attribute:

requestTls?: TlsOptions & { servername?: string };
proxyTls?: TlsOptions & { servername?: string };

@sosoba sosoba added the bug Something isn't working label Dec 7, 2022
@mcollina
Copy link
Member

mcollina commented Dec 7, 2022

Thanks for reporting! Would you like to send a Pull Request to address this issue? Remember to add unit tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants