Skip to content

Conversation

f0ssel
Copy link
Collaborator

@f0ssel f0ssel commented Sep 16, 2025

Fixes multiple issues with command execution and proxy behavior:

  • Fix command output: Commands now inherit stdout/stderr/stdin from parent process
  • Fix unprivileged mode: Set HTTP_PROXY/HTTPS_PROXY environment variables for proper traffic routing
  • Fix HTTPS forwarding: Preserve HTTPS scheme when forwarding requests instead of downgrading to HTTP
  • Fix rule evaluation: Construct full URLs with hostname for accurate pattern matching

@blink-so blink-so bot changed the title F0ssel/fix stdour Fix command output, proxy setup, and HTTPS forwarding Sep 16, 2025
blink-so bot and others added 5 commits September 16, 2025 18:28
CONNECT requests coming through TLS termination were incorrectly
forwarded as regular HTTP requests instead of being handled by
handleConnect. This caused 400 errors when clients used CONNECT.

The fix adds proper CONNECT detection in handleDecryptedHTTPS,
matching the behavior in handleHTTP.
HTTPS_PROXY should use http:// to establish CONNECT tunnels
to the proxy, not https://. This is the standard approach
for HTTP proxies handling HTTPS traffic via CONNECT.

The proxy will still perform TLS termination on the tunneled
connections for full request visibility.
- Add read timeout to detect clients that don't send HTTP requests
- Add detailed TLS connection state logging
- Better error handling for timeout scenarios

This should help diagnose why CONNECT tunnels hang after TLS handshake.
Replace SetReadTimeout (which doesn't exist) with SetReadDeadline.
Also reset the deadline after each successful request to allow
multiple requests on the same TLS connection.
@f0ssel f0ssel merged commit 00ac2f7 into main Sep 16, 2025
2 checks passed
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