Repository navigation
Fix configured proxy being ignored by AWS SDK v3 - #206
apellerano-pw wants to merge 1 commit into
Conversation
The proxy agent was passed via httpOptions.agent, which is an AWS SDK v2 option. SDK v3 does not read it, so requests were sent directly even when the proxy option was set. The agent is now passed through requestHandler as httpAgent/httpsAgent. proxy-agent is loaded with import() inside the async provider. A custom proxyAgent function still works. Also: - Set ESLint ecmaVersion to 2020 so the import() parses. - Add tests for proxy tunneling and custom proxyAgent. - Document that plain http:// endpoints fail through a proxy. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
I confirmed this change is backwards compatible with all listed Node versions in engines block. version 2020 is the last possible option, though. To go to 2021 or newer will require dropping Node 14 in a major
There was a problem hiding this comment.
There's no fix for the HTTP issue even going all the way to the latest release of proxy-agent (8.0.2 at time of writing), so I just documented the flaw. If someone needs this HTTP support, it will likely require a more complex Proxy setup for httpAgent middle-manned by this lib
There was a problem hiding this comment.
These new tests reproduce the failure scenario without the bug fix
|
This bugfix will be required to upgrade I'm shipping the bugfix standalone so it can benefit current users on this major. The v7/v8 upgrade for |
Issue: The
proxyoption was silently ignored. The proxy agent was passed viahttpOptions.agent, an AWS SDK v2 option that SDK v3 doesn't read, so requests went direct.Fix:
requestHandlerashttpAgent/httpsAgent, loadingproxy-agentwithimport(). A customproxyAgentfunction still works.ecmaVersionto 2020 so theimport()parses.proxyAgent.http://endpoints fail through a proxy.PR Checklist
People
@lukemelia