proxy-chain icon indicating copy to clipboard operation
proxy-chain copied to clipboard

feat: add requestFinished event for per request tracking

Open lewis-wow opened this issue 5 months ago • 1 comments

This pull request introduces a new requestFinished event to enable per-request tracking, complementing the existing socket-level tracking provided by the connectionClosed event. Implements #589

Key Changes:

  • New requestFinished Event: The server now emits a requestFinished event upon the completion of a proxied request. This event provides granular details about each request, including its id, connectionId, and the original request object.
  • Test: Added tests to test/server.js to ensure the requestFinished event is emitted reliably across various proxy configurations, including HTTP, HTTPS, and scenarios with upstream proxies.
  • Example: Included a new example file, examples/request_finished.js, to demonstrate how to listen for and utilize the requestFinished event for monitoring purposes.

This enhancement provides more detailed visibility into individual requests flowing through the proxy, allowing for better logging and tracking.

Reference to previous PR: https://github.com/apify/proxy-chain/pull/590

lewis-wow avatar Oct 16 '25 09:10 lewis-wow

I am waiting for https://github.com/apify/proxy-chain/pull/602 to be merged so I can use the HTTPS implementation here and mitigate conflicts from large updates.

lewis-wow avatar Oct 31 '25 08:10 lewis-wow