I use RestClient to get pages over internet. Also this script I made is proxy enabled by using RestClient.proxy = "http://proxy.example.com/"
.
But I dont always use proxy. So instead of manually setting proxy on and off inside the script I wanted the script to read system settings automatically.
The GitHub documentation states:
Often the proxy URL is set in an environment variable, so you can do this to use whatever proxy the system is configured to use:
RestClient.proxy = ENV['http_proxy']
I dont see how can this detect if system proxy in on or not here. It although can detect what proxy address I am using i suppose.
- Also how specifically can I use this?
- Also how do I specify the proxy port?
- AND how can I get the system's proxy settings and then
follow up with
RestClient.proxy = "http://proxy.example.com/"
IF proxy is enabled.