feat: Add proxy environment support#11
Closed
luisAzcuaga wants to merge 12 commits intoepignosisx:mainfrom
Closed
Conversation
Updates httpbin.org test recordings with current timestamps, trace IDs, and IP addresses. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
Handles HTTP CONNECT requests by responding with 200 Connection Established status, preventing proxy requests from reaching real proxy servers and avoiding 503 errors in corporate proxy environments. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Let CONNECT requests pass through to actual proxy instead of intercepting - Remove intercepted 200 response that was breaking tunnel establishment - Add comprehensive debug logging for proxy requests and VCR decisions - Fixes tunneling socket errors in corporate proxy environments 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Fix playback mode to not record responses for replayed requests - Add tracking of playback requests to prevent double recording - Enhance proxy detection with header-based detection (proxy-authorization, proxy-connection) - Use request.passthrough() for better interceptor cleanup on proxy requests - Resolves response recording conflicts in playback mode 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Track CONNECT request targets in proxyTunnels set - Detect when requests are going to established proxy tunnel hosts - Pass through all requests to proxy tunnel hosts without interference - Fix request.passthrough() method calls to use correct API - Refresh test cassettes with current recordings This resolves socket hang up errors in corporate proxy environments by ensuring all proxy-related traffic passes through without VCR intervention after the initial CONNECT tunnel is established. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Replace request.passthrough() with simple return for CONNECT requests - Fixes "request.passthrough is not a function" errors - Ensures proper proxy tunnel establishment in corporate environments - Tests now pass successfully with proxy tunnel tracking 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove noisy debug console.log statements for cleaner test output - Add proxy tunnel detection in response handler to prevent recording - Ensure proxy tunnel requests are completely bypassed by VCR This prevents proxy requests from being recorded/interfered with while maintaining clean test output without debug noise. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Remove proxy tunnel tracking that bypassed all requests to target hosts - Only pass through CONNECT requests needed for tunnel establishment - Allow API requests through tunnels to be recorded/replayed normally - Ensures consistent test results with proper cassette playback This fixes the issue where tests were getting different tokens each run because API requests were bypassing VCR recording/playback. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Clean up console.log statements throughout cassette.ts - Provides cleaner test output without debug noise - VCR functionality remains unchanged, just silent operation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
- Use luisAzcuaga/interceptors#main for CONNECT method support - Enables proxy tunnel handling in corporate environments - Provides built distribution files for direct GitHub installation - Maintains cassette compatibility with existing implementations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Problem
VCR-JS failed in corporate proxy environments with "socket hang up" errors when applications used HTTP CONNECT requests to establish proxy tunnels. This prevented testing in many enterprise
environments.
✅ Solution
Added comprehensive proxy support:
🧪 Testing
📦 Dependencies
🚀 Impact
Footnote:
The changes done with this PR and the changes done here luisAzcuaga/interceptors#2 were required to solve the issue mentioned here #3