h2non / rocky

Full-featured, middleware-oriented, programmatic HTTP and WebSocket proxy for node.js (deprecated)
MIT License
371 stars 24 forks source link

Forwarding with Express integration not working #98

Open pmcnr-hx opened 8 years ago

pmcnr-hx commented 8 years ago

we were trying to integrate Rocky in our integration as a forwarding proxy to intercept requests and responses and be able to record metrics on the traffic. Rocky always seemed to hang when we tried to introduce middleware to modify the responses.

Trying to reduce noise, I then went to try the express example in the repository and, to my surprise, this also hung when processing forward traffic. I tried all x.0 Rocky releases all the way back to 0.1.0 and I could never get the example to work.

Now I'm curious if this aspect of the Express integration has ever worked. It would be great to be able to integrate Rocky in existing Express apps for this kind of use case, so it's a shame I can't get it to work. Any thoughts?

h2non commented 8 years ago

What version of node are you running? Latest major releases may introduce breaking changes in stream and http modules. I was successfully running rocky in node v4 in production for almost a year, but lately I'm not using it.

pmcnr-hx commented 8 years ago

I tested with both 0.12 and 4.

h2non commented 8 years ago

There's a nodejs API issue with stream and event modules. I've to dig in detail and possibly re-implement the current response interceptor.

Express example is working for me in node@6.3, there is only failing the response interceptor afaik.

pmcnr-hx commented 8 years ago

Yes, it is only the response interceptor that is not working in the example. Line 59 never gets called.