TooTallNate / node-proxy-agent

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

defaultPort cannot be read for downstream proxy agents #35

Closed ohookins closed 1 year ago

ohookins commented 5 years ago

In the standard library http client, if an agent is defined, it tries to read the defaultPort of the agent in order to figure out whether or not to append the port number in the final request made to the endpoint (via the agent).

It seems that when using https-proxy-agent via proxy-agent, since this property is defined on https-proxy-agent itself but not dealt with in proxy-agent directly, the standard library http client can't read the property and thus treats any port numbers as "non-standard". Thus we end up with :443 appended to all of our HTTPS URLs. Despite being in the spec, this has proven to break many servers that don't expect it.

I'm not 100% sure on this but it has taken us a few days to get to some reproducible test cases and this seems to be what the problem is. Equally uncertain yet of the solution but thought I'd raise it in case you can rule it out as an issue.

bankexing commented 5 years ago

+1

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.