-
Hi, Sometimes I want to capture the request and response traffic details, in which case I need to set proxy and use Charles. In net/http, we can set the HTTP_PROXY environment variable to achieve this goal, however this does not work in httpexpect. Is there any way we can proxy httpexpect's traffic? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, sorry for late reply. You can provide a custom http client using Also, if you set I didn't test it though. It would be nice to add a test and an example for using proxy with httpexpect. I'll assign |
Beta Was this translation helpful? Give feedback.
-
Added example to README: https://github.com/gavv/httpexpect#proxy-support |
Beta Was this translation helpful? Give feedback.
Hi, sorry for late reply.
You can provide a custom http client using
Config.Client
field. When constructing a client, I guess you can setClient.Transport.Proxy
to a desired proxy.Also, if you set
Config.Client
to a http.Client with DefaultTransport, I think it should also respect HTTP_PROXY variable.I didn't test it though. It would be nice to add a test and an example for using proxy with httpexpect. I'll assign
help wanted
tag to this issue, so someone may add them.