omjadas / hudsucker

Intercepting HTTP/S proxy
https://crates.io/crates/hudsucker
Apache License 2.0
206 stars 35 forks source link

Handle Specific Response? #69

Closed venual closed 1 year ago

venual commented 1 year ago

I need to intercept a response from a specific url, I tried to do this multiple ways the only way I found was to get the request from the specific URL and then use reqwest copy the request into a reqwest request then send it through reqwest client then convert the response to a hyper::Response then return req.into(), in Golang with mitmproxy-go this would be super simple id just match the URL and get the response easily, is there a better way to do this?

omjadas commented 1 year ago

You will want to store the URL in your handler while processing the Request. See https://github.com/omjadas/hudsucker/issues/67#issuecomment-1601869251 for how this can be done.