Skip to content

feat: Add requestFinished event for per-request tracking #590

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shresthaoshan
Copy link

@shresthaoshan shresthaoshan commented Jul 20, 2025

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.

@shresthaoshan shresthaoshan changed the title feat: Add requestFinished event for per-request tracking #589 feat: Add requestFinished event for per-request tracking Jul 20, 2025
@jirimoravcik
Copy link
Member

Hello @shresthaoshan, I noticed that the tests are timing out, could you please take a look? Thanks

@oshanshrestha-grepsr
Copy link

Hello @shresthaoshan, I noticed that the tests are timing out, could you please take a look? Thanks

@jirimoravcik the tests seems to be already failing, even before this PR. Do you want me to look into it?

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.

3 participants