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

**URL:** <https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660>\
**Category:** Ruby API\
**Created:** [February 17, 2020, 5:15pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660 "2020-02-17T17:15:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Whaat](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@Whaat](https://forums.sketchup.com/u/Whaat)\
**Post date:** [February 17, 2020, 5:15pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/1 "2020-02-17T17:15:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 17, 2020, 6:34pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/2 "2020-02-17T18:34:54Z")

</div>

> [@Whaat](#):
>
> so that it will work from behind a proxy?

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

---

<div class="post-metadata">

**Author:** ![thomthom](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/thomthom/32/12606_2.png) [@thomthom](https://forums.sketchup.com/u/thomthom)\
**Post date:** [February 17, 2020, 6:37pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/3 "2020-02-17T18:37:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![DanRathbun](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/danrathbun/32/500_2.png) [@DanRathbun](https://forums.sketchup.com/u/DanRathbun)\
**Post date:** [February 17, 2020, 8:38pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/4 "2020-02-17T20:38:24Z")

</div>

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 …_

- [[code] read\_ipconfig()](https://forums.sketchup.com/t/code-read-ipconfig/116689)

---

<div class="post-metadata">

**Author:** ![jiminybillybob](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/jiminybillybob/32/197139_2.png) [@jiminybillybob](https://forums.sketchup.com/u/jiminybillybob)\
**Post date:** [February 18, 2020, 8:34am UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/5 "2020-02-18T08:34:50Z")

</div>

> [@thomthom](#):
>
> hmm… I haven’t dealt with proxies so I’m afraid that I don’t have any suggestions here…

Same for me, sorry Dale.

---

<div class="post-metadata">

**Author:** ![Whaat](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@Whaat](https://forums.sketchup.com/u/Whaat)\
**Post date:** [February 20, 2020, 4:50am UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/6 "2020-02-20T04:50:05Z")

</div>

Thanks for the input everyone. I will keep investigating

---

<div class="post-metadata">

**Author:** ![Whaat](https://avatars.discourse-cdn.com/v4/letter/w/b4bc9f/32.png) [@Whaat](https://forums.sketchup.com/u/Whaat)\
**Post date:** [July 20, 2020, 8:28pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/7 "2020-07-20T20:28:28Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![kengey](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/kengey/32/234545_2.png) [@kengey](https://forums.sketchup.com/u/kengey)\
**Post date:** [July 21, 2020, 12:32pm UTC](https://forums.sketchup.com/t/how-to-make-http-requests-from-ruby-api-when-behind-http-proxy/116660/8 "2020-07-21T12:32:54Z")

</div>

> [@Whaat](#):
>
> 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.
