How to make HTTP requests from Ruby API when behind HTTP proxy?

We use Ruby’s Net::Http class to make synchronous HTTP requests in our plugins (and for SU2016 support) and it works well. But recently, we have found that this class seems to fail to connect when the user is behind a proxy.

Is there an easy way to automatically detect a user’s proxy configuration settings and to configure Net::Http so that it will work from behind a proxy? Thanks!

@jiminybillybob @thomthom

And have SketchUp’s licensing behind that Proxy working, too?

hmm… I haven’t dealt with proxies so I’m afraid that I don’t have any suggestions here…

Does this little method I just cobbled together give any info that helps ?
(Like Thomas haven’t dealt with proxy configs.)

On my machine the first “ACTIVE” compartment 1 has this key / value:
"WINS Proxy Enabled"=>"No"

Moved the code example to it’s own thread …

Same for me, sorry Dale.

Thanks for the input everyone. I will keep investigating

Just curious, if a company firewall has given access to sketchup.exe to reach the internet, does that also mean that the ruby DLL x64-msvcrt-ruby250.dll would consequently also have access? (for using Ruby’s standard library Net::HTTP, etc.)

Or could the Ruby standard library be blocked even though sketchup.exe is not?

As far as I know the permission is given to the process and thus all modules loaded by that process.