Ruby
Net::HTTP will automatically create a proxy from the
http_proxy
environment variable if it is present. So you can use:
ENV['http_proxy'] = 'http://127.0.0.1:9090' # your http://address:port here
and Net::HTTP will use it for all requests by default.
By default, Ruby on macOS might not trust Proxyman 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.$ env SSL_CERT_FILE=~/.proxyman/proxyman-ca.pem ruby my_script.rb
Last modified 1yr ago