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

proxyReq event is not emitted for HTTP proxy. #721

Open
wclr opened this issue Oct 28, 2014 · 3 comments
Open

proxyReq event is not emitted for HTTP proxy. #721

wclr opened this issue Oct 28, 2014 · 3 comments

Comments

@wclr
Copy link

wclr commented Oct 28, 2014

It seems that proxyReq event is not emitted for HTTP proxy:

https://github.com/nodejitsu/node-http-proxy/blob/3e8ee042fb8ac93e6f8c347aa4ce49eeec968645/lib/http-proxy/passes/web-incoming.js#L114

no other emits in the code.

@jcrugzz
Copy link
Contributor

jcrugzz commented Oct 29, 2014

@whitecolor what do you mean? the event is emit before anything happens. The only caveat here is that you must be using the event emitter interface and not passing a callback. this should be fixed in later versions.

@hgwood
Copy link

hgwood commented Nov 8, 2014

@whitecolor The proxyReq event (or any event for that matter) will not be emitted if you provide an error callback to either the proxy.web or proxy.ws methods.

This behavior is not documented anywhere, to my knowledge. I had to read the code to figure it out.

@jcrugzz
Copy link
Contributor

jcrugzz commented Nov 9, 2014

@hgwood yes its remanent of when the callback use case used to not be an event emitter. This will be changed, if you want to take a stab at it, go for 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

No branches or pull requests

3 participants