Skip to content

Fix configured proxy being ignored by AWS SDK v3 - #206

Open
apellerano-pw wants to merge 1 commit into
ember-cli-deploy:masterfrom
ProsperWorks:fix-proxy-config-ignored-bug
Open

apellerano-pw wants to merge 1 commit into
ember-cli-deploy:masterfrom
ProsperWorks:fix-proxy-config-ignored-bug

Conversation

@apellerano-pw

Copy link
Copy Markdown
Contributor

Issue: The proxy option was silently ignored. The proxy agent was passed via httpOptions.agent, an AWS SDK v2 option that SDK v3 doesn't read, so requests went direct.

Fix:

  • Pass the proxy agent through requestHandler as httpAgent/httpsAgent, loading proxy-agent with import(). A custom proxyAgent function still works.
  • 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.

PR Checklist

  • Add tests
  • Add documentation
  • Prefix documentation-only commits with [DOC]

People

@lukemelia

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>
Comment thread .eslintrc.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread README.md

@apellerano-pw apellerano-pw Oct 16, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Comment thread tests/lib/s3-test.js

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These new tests reproduce the failure scenario without the bug fix

@apellerano-pw

Copy link
Copy Markdown
Contributor Author

This bugfix will be required to upgrade proxy-server to v7 or v8, which requires dropping Node support below 20, and a major version bump for this lib.

I'm shipping the bugfix standalone so it can benefit current users on this major. The v7/v8 upgrade for proxy-server is now unblocked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant