4

I'm trying to setup my heroku app to have an static IP using QuotaGuard (I know proximo is the other option, but it's pretty expensive).

I added the heroku QuotaGuard Static addon and got the two IPs it generates as well as the proxy url.

What is my next step? (aka how do I tell my Rails app to use the proxy provided by QuotaGuard)

  • I see they have ruby code samples using REST-client and HTTParty, but do I put that somewhere like in the application.rb??
Varun
  • 675
  • 6
  • 16
  • Have you read the [heroku docs](https://devcenter.heroku.com/articles/quotaguard#using-with-rails) on this topic? – Srikanth Venugopalan May 01 '15 at 17:14
  • Yea I read the docs, I wasn't sure where to place the code they show there for the HTTPs setup, I"m thinking application.rb or something, but I reached out to QG support and they told me to with the SOCKS setup, and the instructions for that are pretty clear in the docs. The thing I"m wondering now is how to test that the proxy is working? – Varun May 01 '15 at 18:46
  • when it do ping myDomain.com, it shows an IP different than the two QG setup for me, so not sure how to test it – Varun May 01 '15 at 18:47
  • We've just released the feature you were looking for, directing INBOUND traffic via a static IP. Details on our [solutions page](http://support.quotaguard.com/solution/categories/5000031112/folders/5000260866/articles/5000633969-getting-started-with-our-inbound-proxy) – Tim Williams Jun 14 '15 at 14:08

1 Answers1

3

Most likely a bit too late to answer this question, but still.

Like you said, the first step to configuring QuotaGuard Static is provisioning the addon on Heroku (either via the Web Interface or the Heroku CLI). From there, you are able to get your two outbound IPs, and your proxy URL. The two IPs you were given should be whitelisted on whichever remote service you are trying to access.

As you mentioned, the documentation gives you a couple of samples using Rest Client for Ruby on Rails. This snippet should pretty much go anywhere you want to access whichever resource you need to access via the static IP Addresses. Assuming you want to access a Web Service hosted on an Amazon EC2 instance with elastic IP 1.2.3.4, your would write:

RestClient.proxy = ENV["QUOTAGUARDSTATIC_URL"]
res = RestClient.get("http://1.2.3.4/yourWebService")

And from there process the response stored in res appropriately. This code would go in say whichever controller's method you'll be using to access the remote web service. In this case, you also need to add the Rest Client to your controller, so at the top of that file you shoud also add require "rest-client" . Don't forget to add the rest-client gem to your Gemfile.

Summing up, basically the snippets from the documentation go wherever it is you want to use the proxy to access a remote service requiring a fixed, whitelisted set of IP addresses.

Source: https://devcenter.heroku.com/articles/quotaguardstatic

jvrsgsty
  • 588
  • 4
  • 18