Skip to content
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

Expose a way to listen to proxy events #2

Open
RavenHursT opened this issue Jan 20, 2016 · 2 comments
Open

Expose a way to listen to proxy events #2

RavenHursT opened this issue Jan 20, 2016 · 2 comments

Comments

@RavenHursT
Copy link

https://github.com/nodejitsu/node-http-proxy#listening-for-proxy-events

Right now, the module only exposes the thunk wrapper. There's no handle for the consumer of this library to get ahold of the proxy instance so that something like the following can be done:

proxy.on('proxyReq', (err, req, res) => {
  console.log('Outgoing proxy request => ' , req)
}
@ming-codes
Copy link
Owner

May I ask what is your specific use case?

Proxying is usually done as the last of the middleware chain where you don't need to do anything else.

If the proxy instance are to be exposed, I would imagine you'll want to do things with it that will eventually yield down to the next middleware.

@RavenHursT
Copy link
Author

Just wanting to verify (and log) in a production environment the requests that are passing through the proxy. Not to mention, have some introspection into the requests that are being generated by the proxy and the responses that are being sent back through..

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

No branches or pull requests

2 participants