Ruby
Capture HTTP/HTTPS Traffic from Ruby with Proxyman
Last updated
Capture HTTP/HTTPS Traffic from Ruby with Proxyman
Last updated
Proxyman v4.7.0 or later can capture HTTP/HTTPS traffic from Ruby with 1-click.
1-click solution: No need to manually set HTTP Proxy config or trust the self-signed certificate.
Support many Ruby libraries: http, net/http, net/https, httparty, and faraday.
Open Proxyman -> Setup Menu -> Automatic Setup
Click on "Open New Terminal"
Accept the Apple Script permission prompt if needed
The New Terminal app is launched -> You can start your Ruby Backend Server, or Run scripts => Proxyman automatically captures all traffic.
Done ✅
Net::HTTP will automatically create a proxy from the http_proxy
environment variable if it is present.
So you can use:
and Net::HTTP will use it for all requests by default.
Ref: https://stackoverflow.com/questions/15792999/how-to-set-a-proxy-in-rubys-net-http
By default, Ruby on macOS might not trust Proxyman's self-signed certificate. As a result, you might encounter SSL Error if you try to intercept HTTPS traffic.
You can explicitly tell Ruby to use Proxyman Certificate by using SSL_CERT_FILE
env.