Skip to content

Add Support for Proxy TunnelingΒ #6725

Open
@armandoqf

Description

Is your feature request related to a problem? Please describe.

Axios currently does not have native support for proxy tunneling, particularly for HTTPS requests. This limitation makes it challenging to route requests through proxies in environments that require tunneling, especially when dealing with secure servers, authenticated proxies, and complex redirect scenarios.

Proxy tunneling is critical for:

Routing HTTP and HTTPS traffic through corporate proxies.
Supporting authentication and environmental configurations (e.g., http_proxy, https_proxy, and no_proxy environment variables).
Handling redirects and secure connections in proxy scenarios.

Describe the solution you'd like

We propose implementing native support for proxy tunneling in Axios, leveraging the widely used http-proxy-agent library. This solution has been designed to handle a variety of use cases, ensuring robust and flexible functionality.

The following cases are supported by the solution:

  • Supports proxies with and without authentication
  • Respects HTTP_PROXY and HTTPS_PROXY environment variables
  • Supports both HTTP and HTTPS servers
  • Supports both HTTP and HTTPS proxies
  • Handles various redirect types
  • Supports exclusions via NO_PROXY environment variable

Benefits:

  • Eliminates the need for external workarounds by directly integrating proxy tunneling into Axios.
  • Simplifies proxy configurations for Axios users, especially in enterprise use cases.
  • Enhances Axios's capabilities for routing secure traffic through proxies, making it a more versatile HTTP client.
  • Handles complex scenarios, including secure proxy-server combinations and advanced redirect behaviors.

Before proceeding with a pull request, we would like feedback from the maintainers on:

  • Alignment of this feature with Axios's roadmap.
  • Any additional use cases or concerns to consider during implementation.

We have a solution ready that supports the described use cases using http-proxy-agent and are eager to contribute to the project.

Branch with changes : https://github.com/armandoqf/axios/tree/feature/proxying-https-requests

Thank you for your time and consideration!

Describe alternatives you've considered

No response

Additional context/Screenshots

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions