Skip to content

HttpRequestException Lacks StatusCode Information on ProxyTunnelError #105546

@cenceg

Description

@cenceg

Description

When HttpRequestException is thrown with ProxyTunnelError HttpRequestError, the StatusCode is not included. This behavior may not be ideal for scenarios involving web scraping where backconnecting proxy is utilized extensively.

In web scraping, we mostly do not connect to the proxy directly. Instead, a backconnecting proxy service is employed which dynamically assigns different proxies which is convenient to provide rotating proxies. The CONNECT request is critical as it is the point where the backconnecting proxy might reject a request. Typically, proxies communicate the nature of such rejections via HTTP status codes (e.g., 429 when request rate is too high, 502 when no available proxy). Some will use HTTP headers detailing the reason too.

Currently, we have to parse the Message to find the actual status code

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions