1-702-818-1043
support@quotaguard.com
Login

How to add a proxy server to Ruby Geocoder

Approximate time to read: 1 min


One undocumented feature is its ability to route all requests through a proxy server. This can be very useful when trying to use Ruby Geocoder* with Heroku or other PaaS that hide behind shared ip addresses as it allows you to reclaim your daily request usage from Google. This example shows it using the QuotaGuard proxy. Note that for unauthenticated connections you don’t need the _username:password@* prefix.

Its also a good idea to up the timeout a bit as going through a proxy may slow your request down.

config/initializers/geocoder.rb

Geocoder.configure(
  ...
  :http_proxy => 'username:password@http://quotaguard.com:9292',
  :timeout => 5 
)

Ready to Get Started?

Get in touch or create a free trial account