Skip to content

Conversation

@pru55e11
Copy link
Contributor

@pru55e11 pru55e11 commented Aug 27, 2025

This fixes the proxy bypass issue that occurred after the migration from AWS SDK v2 to v3 in March 2023.

PROBLEM:

  • AWS SDK v3 requires different proxy configuration than v2
  • Adobe I/O CLI S3 uploads were bypassing corporate proxies
  • ECONNRESET errors in corporate environments

Inspired-by: PR #224 by pat-lego
Fixes: proxy bypass for Adobe I/O CLI S3 operations

SOLUTION:

  • Add NodeHttpHandler with ProxyAgent for AWS SDK v3 compatibility
  • Support standard proxy environment variables (https_proxy, HTTPS_PROXY, http_proxy, HTTP_PROXY)
  • Maintain CommonJS compatibility (fixes ES6 import issues from PR Update remote-storage.js #224)
  • Priority: HTTPS_PROXY > HTTP_PROXY (HTTPS takes precedence for S3)
  • Only configure requestHandler when proxy is actually set

Tests

  • Tested locally with linked library and observed traffic via MITM proxy.
  • Comprehensive proxy configuration tests for all environment variables
  • Proxy priority testing (HTTPS takes precedence)
  • No-proxy scenario testing

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@pru55e11 pru55e11 force-pushed the fix/aws-sdk-v3-proxy-support branch from 2dff802 to 1f4b2c8 Compare August 27, 2025 22:48
@codecov
Copy link

codecov bot commented Aug 27, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@shazron
Copy link
Member

shazron commented Aug 28, 2025

There's also the AWS https://github.com/awslabs/aws-sdk-v3-js-proxy but there is one issue from a dev that says it doesn't work - the approach in the PR is what is recommended

@pru55e11 pru55e11 force-pushed the fix/aws-sdk-v3-proxy-support branch from 1f4b2c8 to 4bbeddb Compare August 28, 2025 02:53
@pru55e11 pru55e11 marked this pull request as ready for review August 28, 2025 02:59
@pru55e11 pru55e11 merged commit e3c210a into master Aug 28, 2025
9 checks passed
@pru55e11 pru55e11 deleted the fix/aws-sdk-v3-proxy-support branch August 28, 2025 05:43
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.

4 participants