Greg Reimer
                                            Greg Reimer
                                        
                                    I think what was happening was [this line](https://github.com/greim/hoxy/blob/1e7d50ae833d1358bf1cf2e24daad9694d9b3a68/src/cycle.js#L66): ``` js this._writable.on('error', this._respProm.reject); ``` ...was pumping errors into the promise before [it was yielded](https://github.com/greim/hoxy/blob/1e7d50ae833d1358bf1cf2e24daad9694d9b3a68/src/proxy.js#L174), which is what sets up the error...
This is really two separate issues: **Hoxy fails to handle an error properly** This is just a bug in the existing behavior. My previous fix didn't work, and I think...
I added some changes and a unit test to the PR branch that shows the `error` event being emitted. Can you pull the branch and re-verify? Also look at the...
I know exactly where the error is being thrown. Can someone/everyone describe their ideal behavior and I'll be happy to take a shot at some kind of fix/workaround. @sholladay it...
@mitchhentges @sholladay @nerdbeere thoughts?
Yup. It's overwritten before the very first intercept here: https://github.com/greim/hoxy/blob/85242564df3415f367ebcb040844be5d203a1404/src/request.js#L149 Something like ``` js req.origHeaders; // frozen, unaltered copy of original request headers res.origHeaders; // frozen, unaltered copy of original...
That would be a pretty sweeping conceptual change to how Hoxy works. If the origHeaders thing works for you, I'd be happy to add that though.
Take a look at the orig-headers branch and let me know if it works for you.
You should be able to determine whether the client connected using https or http by: 1. If the client connects directly to hoxy, by whether you're running hoxy with tls...
It might also be nice to also support regex capturing groups: ``` js proxy.intercept({ phase: 'request', url: /bar\-(\d+)/ }, function(req) { console.log(req.urlData[1]); }); ``` ``` js proxy.intercept({ phase: 'request', url:...