Skip to content

ProxyAgent ignores connect timeout options and lacks documentation for signal parameter #3944

@timursevimli

Description

@timursevimli

Bug Description

The connect options passed to ProxyAgent are being ignored, despite the type definitions suggesting they should work. This appears to be both a potential bug and a documentation issue.

Reproducible By

const { ProxyAgent } = require('undici');

const agent = new ProxyAgent({
  uri: 'http://8.8.8.8:8000',
  connect: {
    signal: AbortSignal.timeout(100),
    timeout: 100,
  },
});

fetch('https://example.com', {
  dispatcher: agent,
})
  .then((res) => res.text())
  .then(console.log)
  .catch(console.error);

Current Behavior

The timeout and signal parameters in connect options are not being processed when passed to ProxyAgent

Expected Behavior

According to the documentation:

  • ProxyAgentOptions extends AgentOptions
  • AgentOptions extends PoolOptions
  • PoolOptions extends ClientOptions
  • ClientOptions includes connect parameter which accepts ConnectOptions

Therefore, the timeout and signal options should work when passed through the connect parameter.

Relevant Documentation Links

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions